xtreme newbie: question about data in datagrid (mysql)

J

Jeff

OS : winXP pro (sp2)
IDE: VS .NET 2003

This is my code for adding data to my datagrid (DataGrid1)

MySqlConnection conn = new
MySqlConnection(ConfigurationSettings.AppSettings["DB_Connection_string"]);
conn.Open();
MySqlDataAdapter adapter = new MySqlDataAdapter();
adapter.SelectCommand = new MySqlCommand("select * from Member", conn);
DataSet dataset = new DataSet();
adapter.Fill(dataset, "member");
DataGrid1.DataSource = dataset;
DataGrid1.DataMember = "member";

When I run this code the datagrid becomes invisible... I'm not sure why I
don't see the datagrid, datagrid's visible property is set to true....... So
I don't think the problem is there.... I've also tested this script:
adapter.Fill(dataset, "member");
and it returns one row, which is correct, because the table member have only
one record...

I'm wondering maybe the problem is related to me using * in the select
statement...

Please, give me some tips about what I should do to fix this problem!!!

Jeff
 
P

Pat

Good
Patrick

Jeff said:
Problem solved


Jeff said:
OS : winXP pro (sp2)
IDE: VS .NET 2003

This is my code for adding data to my datagrid (DataGrid1)

MySqlConnection conn = new
MySqlConnection(ConfigurationSettings.AppSettings["DB_Connection_string"]);
conn.Open();
MySqlDataAdapter adapter = new MySqlDataAdapter();
adapter.SelectCommand = new MySqlCommand("select * from Member", conn);
DataSet dataset = new DataSet();
adapter.Fill(dataset, "member");
DataGrid1.DataSource = dataset;
DataGrid1.DataMember = "member";

When I run this code the datagrid becomes invisible... I'm not sure why I
don't see the datagrid, datagrid's visible property is set to true.......
So I don't think the problem is there.... I've also tested this script:
adapter.Fill(dataset, "member");
and it returns one row, which is correct, because the table member have
only one record...

I'm wondering maybe the problem is related to me using * in the select
statement...

Please, give me some tips about what I should do to fix this problem!!!

Jeff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top