VB.NET 2010
I used this code in ASPNET 4.0 page with success. But now in the Desktop world not sure how to bind it?
If I take out the Me.DataGridView1.DataBindings line, I do not get an error but the grid is empty.
I takes a while to run so I am sure its filling the reader.
TIA
I used this code in ASPNET 4.0 page with success. But now in the Desktop world not sure how to bind it?
If I take out the Me.DataGridView1.DataBindings line, I do not get an error but the grid is empty.
I takes a while to run so I am sure its filling the reader.
TIA
Code:
Dim cnn As SqlConnection
Dim cmd As New SqlCommand
Dim Retval As String = ""
Dim connStr As String = gblConnectionString
cnn = New SqlConnection(connStr)
Try
cnn.Open()
With cmd
.Connection = cnn
.CommandText = "uspGetLdapHierarchyByTopEid"
.CommandType = CommandType.StoredProcedure
.Parameters.AddWithValue("sTopEid", Me.cboChooseEnterpriseID.Text)
.Parameters(0).SqlDbType = SqlDbType.NVarChar
Me.DataGridView1.DataSource = .ExecuteReader()
Me.DataGridView1.DataBindings( <<<<< ????
End With
Catch ex As Exception
MsgBox(ex.Message)
End Try
DougP