Hi,
I write some code to retrieve information from Database.
After I bind the DBGrid it shows the result somehow like a link to the
Table.
When I click on the Table link it displays the whole content. It probably
has
to do with parent-child relationship, but I only have one result set.
Here is the code that accesses Northwind database:
SqlConnection conn = new SqlConnection("data source=YOUR-136F2019DC;initial
catalog=Northwind;password=mypassword;persist security info=True;user
id=sa;workstation id=YOUR-136F2019DC;packet size=4096");
conn.Open();
SqlCommand cmd1 = conn.CreateCommand();
cmd1.CommandText = "Select top 100 * from Customers";
cmd1.CommandType = CommandType.Text;
SqlCommand cmdCust = conn.CreateCommand();
cmdCust.CommandText = "Select top 100 * from Customers";
cmdCust.CommandType = CommandType.Text;
SqlDataAdapter daCust = new SqlDataAdapter(cmdCust);
DataSet dsCust = new DataSet();
daCust.Fill(dsCust);
dgCust.DataSource = dsCust;
dgCust.Expand(-1);
conn.Close();
It's probably some setting I am not aware of.
Thanks,
Doru