ListBox DataSource
I have this code joined to my button (maybe i need to remove the connection from the event and put above the event code .. let me know if that is misstake:
private void button1_Click(object sender, System.EventArgs e)
{
string source = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\\Documents and Settings\\Jugoars\\My Documents\\Visual Studio Projects\\WindowsApplication3\\Fillmark.mdb";
string selection = "SELECT * FROM mytable WHERE naslov IS NOT NULL";
OleDbDataAdapter da = new OleDbDataAdapter(selection , source);
DataSet ds = new DataSet();
da.Fill(ds);
this.listBox1.DataSource = ds;
}
and somehow i succeed to make not crash my app at least but now instead records from my database i'm receiving next message within ListBox after i click the button:
System.Data.DataViewManagerListItemTypeDescriptor
i'm little confused here and hane no idea this message why is standing for ... lol
Nearly i forgot to point out that maybe i could mapPath to the DB location like we do it within VBScript manner in ASP/ASP.NET Data Source=" & Server.MapPath("Fillmark.mdb").... maybe there is some System atribute that could provide maping the path and ensure my DB's location ... thanks in advance
Share what you know, learn what you don't
|