L
Lasse Edsvik
Hello
have problems populating a listbox with data from an accessdb. cant figure
it out, have clicked "test connection" and it works but not this:
using System.Data;
using System.Data.OleDb;
/*
lots of code here
*/
private void button1_Click(object sender, System.EventArgs e)
{
OleDbConnection Conn = new
OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0; User Id=; Password=;
Data Source=C:\db.mdb");
OleDbCommand SCmd = new OleDbCommand("SELECT * FROM Products");
OleDbDataAdapter pDA = new OleDbDataAdapter();
pDA.SelectCommand = SCmd;
DataSet DS = new DataSet();
pDA.Fill(DS,"Products");
listBox1.DataSource = DS;
}
have problems populating a listbox with data from an accessdb. cant figure
it out, have clicked "test connection" and it works but not this:
using System.Data;
using System.Data.OleDb;
/*
lots of code here
*/
private void button1_Click(object sender, System.EventArgs e)
{
OleDbConnection Conn = new
OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0; User Id=; Password=;
Data Source=C:\db.mdb");
OleDbCommand SCmd = new OleDbCommand("SELECT * FROM Products");
OleDbDataAdapter pDA = new OleDbDataAdapter();
pDA.SelectCommand = SCmd;
DataSet DS = new DataSet();
pDA.Fill(DS,"Products");
listBox1.DataSource = DS;
}