non uso alcuna libreria esterna.
Ho più progetti, creati da me, tutti nella solita soluzione.
l'eccezione viene sollevata
codice:
Function RiempiDataGrid(ByVal querysql As String)
Dim table As New DataTable
Try
' The SqlConnection class allows you to communicate
' with SQL Server and DataTable.
' A SqlCommand object is used to execute the SQL commands.
Dim mycmd As New SqlCommand(querysql, con)
Dim DataAdapter As New SqlDataAdapter(mycmd)
Dim commandBuilder As New SqlCommandBuilder(DataAdapter)
' The SqlDataAdapter is responsible for using
' a SqlCommand object to fill a DataSet.
DataAdapter.Fill(table)
' Set the DataGrid caption, bind it to the DataSet,
' and then make it Visible
DataAdapter.Dispose()
mycmd.Dispose()
commandBuilder.Dispose()
Catch sqlExc As SqlException
MsgBox(sqlExc.ToString, MsgBoxStyle.OkOnly, "SQL Exception Error!")
Catch ex As Exception
MsgBox(ex.Message)
End Try
Return table
table.Dispose()
End Function
al dataadapter.fille(table)
non so più dove battere la testa. Se vuoi posso zippare e uppare la soluzione se può essere di aiuto