Exception occure when use datagrid to present Data from database
Hello,
I'm new comer to VB.NET, I'm trying to write a simple form, use datagrid to present data from a DataSet. I use only one table in dataset, and I can preview full data in sqlDataAdapter, as I desire, at design time. In the form I have a "View" button allow display full data selected from database in datagrid at runtime, the code for click event as follow:
Private Sub cmdView_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdView.Click
Area.Clear()
SqlDataAdapter_Area.Fill(Area, "Area")
End Sub
In that: "Area" is dataset's name, and "SQLDataAdapter_Area" is DataAdapter's name of dataset Area
It's seem nothing wrong at design time but at the runtime when I click button "View", I got an exception like that:
An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred in system.data.dll
I don't understand this message, can you tell me ?
Thanks in advance