H
Harry Whitehouse
I have some code (below) to display the column information for a specified
SQL table. It works reasonably well, but when the grid displays it shows
the name of the table underlined and clickable. Clicking on the table name
shown in the grid expands the table to show all the rows and columns as I
want.
I realized that I needed to add the .Expand(-1) member to even show the
table name automatically. But what grid property do I set or invoke that
will just show the full table without the user having to click on the table
name?
TIA
Harry
String myQuery = "select * from syscolumns where id = object_id('" +
dbname.ToString() +
".." + tablename + "')";
SqlCommand myCommand = new SqlCommand(myQuery);
myCommand.Connection=sqlConnection1;
SqlDataAdapter da = new SqlDataAdapter(myQuery, sqlConnection1);
DataSet ds = new DataSet();
da.Fill(ds,tablename.ToString());
dataGrid1.DataSource=ds;
dataGrid1.Expand(-1);
SQL table. It works reasonably well, but when the grid displays it shows
the name of the table underlined and clickable. Clicking on the table name
shown in the grid expands the table to show all the rows and columns as I
want.
I realized that I needed to add the .Expand(-1) member to even show the
table name automatically. But what grid property do I set or invoke that
will just show the full table without the user having to click on the table
name?
TIA
Harry
String myQuery = "select * from syscolumns where id = object_id('" +
dbname.ToString() +
".." + tablename + "')";
SqlCommand myCommand = new SqlCommand(myQuery);
myCommand.Connection=sqlConnection1;
SqlDataAdapter da = new SqlDataAdapter(myQuery, sqlConnection1);
DataSet ds = new DataSet();
da.Fill(ds,tablename.ToString());
dataGrid1.DataSource=ds;
dataGrid1.Expand(-1);