I have a datagrdid on my form, on page load it calls a function to connect to a sql db and populate it as shown in the code below.
All works fine, problem is, i have to click on a node to open up the table to show all records. I want it to open with the datagrid completely expanded.Code:Dim myDataSet As New DataSet() Dim connString As String = SQL_CONNECTION_STRING Dim cnn As SqlConnection = New SqlConnection(connString) Dim myCommand As SqlCommand = New SqlCommand("Select * FROM Orders", cnn) myCommand.CommandType = CommandType.Text cnn.Open() Dim myDataAdapter As SqlDataAdapter = New SqlDataAdapter(myCommand) Try myDataAdapter.Fill(myDataSet, "Employees") Catch MsgBox("Error in connecting to database. Call Computer about to implode!!") End Try cnn.Close() dgEmployees.DataSource = myDataSet
I do this in other apps but i bind all columns etc at design time, the table i am sending in changes dynamically, i just want to display all the data without having the user click on a plu sign to expand the table.
i have tried
but to no availCode:dgEmployees.DataSource = myDataSet.DefaultViewManager
Any ideas?




Reply With Quote