Datagrid not behaving
-
I have a datagrid bound to a dataset but its not displaying the table - initially all it shows is a '+', if I click on this it expands to 'Tables', and if I click on that I get the table that I want displayed. Can anyone enlighten me as to why it doesn't display the table directly? Here is the database code (all this is done in the Form_Load handler)... OleDbConnection conn = new OleDbConnection(); conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" + "User Id=Admin;Password=;" + @"Data Source=C:\Visual Studio Projects\mscale\debug\di-80product.mdb;"; conn.Open(); OleDbDataAdapter adapter = new OleDbDataAdapter(); OleDbCommand selectCmd = new OleDbCommand("SELECT * FROM PRODUCT", conn); adapter.SelectCommand = selectCmd; DataSet ds = new DataSet("ds"); dataGrid1.DataMember = "PRODUCT"; dataGrid1.DataSource = ds; adapter.Fill(ds);
-
I have a datagrid bound to a dataset but its not displaying the table - initially all it shows is a '+', if I click on this it expands to 'Tables', and if I click on that I get the table that I want displayed. Can anyone enlighten me as to why it doesn't display the table directly? Here is the database code (all this is done in the Form_Load handler)... OleDbConnection conn = new OleDbConnection(); conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" + "User Id=Admin;Password=;" + @"Data Source=C:\Visual Studio Projects\mscale\debug\di-80product.mdb;"; conn.Open(); OleDbDataAdapter adapter = new OleDbDataAdapter(); OleDbCommand selectCmd = new OleDbCommand("SELECT * FROM PRODUCT", conn); adapter.SelectCommand = selectCmd; DataSet ds = new DataSet("ds"); dataGrid1.DataMember = "PRODUCT"; dataGrid1.DataSource = ds; adapter.Fill(ds);