|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
viewing datagrid
Hi
I have a datagrid. N i want to transfer my data from the database to the datagrid. But the problem is I cant display the datagrid when i run the codes.. It can only display the header.. Hope sumone can help me solve this prob. Here is my code: Public Sub bindListControl() Dim myConn As OleDbConnection Dim myOleDbAdapter As OleDbDataAdapter Dim connStr, accessStr As String Dim myDataSet As New DataSet connStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data source=" & _ "d:\db1.mdb" accessStr = "SELECT * from MC" myConn = New OleDbConnection(connStr) myConn.Open() myOleDbAdapter = New OleDbDataAdapter(accessStr, myConn) myOleDbAdapter.Fill(myDataSet, "studentMCGrid") studentMCGrid.DataSource = myDataSet.Tables("studentMCGrid") studentMCGrid.DataBind() myConn.Close() End Sub |
|
#2
|
||||
|
||||
|
viewing datagrid
Why do you use the following code for?? :
>studentMCGrid.DataBind() I don't get this, maybe, when you delete it in your code, you might see your datatable. goodluck, reinier |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > .Net Development > viewing datagrid |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|