I have a very simple program that I'm trying to convert from Access tables to MSQL. But when I do I get the following error and this line is highlighted in the code.
Thi this is the error message whent he program is being tesed - -
An unhandled exception of type 'System.Data.SqlClient.SqlException' occured in system.data.dll. Additional informtuion:System error.
This line is highlighted - -
SqlDataAdapter1.Fill(DataSet11) 'flll dataset1 when form opens
During the creation of the Data Adapter, a message states - The wizard can not automatically create queries for updating the database becausee your query does not include some primary key columns. Do you wish to add the primary key columns to your query? If I click on Yes or No the program still generates the errror during debug. I'm not sure why in MSQL it asks for a primary key, in an application that uses access it does ask.
Below is the complete code, as for now.
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
DataSet11.Clear()
SqlDataAdapter1.Fill(DataSet11) 'flll dataset1 when form opens
End Sub
Private Sub SqlDataAdapter1_RowUpdated(ByVal sender As System.Object, ByVal e As System.Data.SqlClient.SqlRowUpdatedEventArgs) Handles SqlDataAdapter1.RowUpdated
End Sub
Private Sub SqlConnection1_InfoMessage(ByVal sender As System.Object, ByVal e As System.Data.SqlClient.SqlInfoMessageEventArgs) Handles SqlConnection1.InfoMessage
End Sub
End Class
Thi this is the error message whent he program is being tesed - -
An unhandled exception of type 'System.Data.SqlClient.SqlException' occured in system.data.dll. Additional informtuion:System error.
This line is highlighted - -
SqlDataAdapter1.Fill(DataSet11) 'flll dataset1 when form opens
During the creation of the Data Adapter, a message states - The wizard can not automatically create queries for updating the database becausee your query does not include some primary key columns. Do you wish to add the primary key columns to your query? If I click on Yes or No the program still generates the errror during debug. I'm not sure why in MSQL it asks for a primary key, in an application that uses access it does ask.
Below is the complete code, as for now.
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
DataSet11.Clear()
SqlDataAdapter1.Fill(DataSet11) 'flll dataset1 when form opens
End Sub
Private Sub SqlDataAdapter1_RowUpdated(ByVal sender As System.Object, ByVal e As System.Data.SqlClient.SqlRowUpdatedEventArgs) Handles SqlDataAdapter1.RowUpdated
End Sub
Private Sub SqlConnection1_InfoMessage(ByVal sender As System.Object, ByVal e As System.Data.SqlClient.SqlInfoMessageEventArgs) Handles SqlConnection1.InfoMessage
End Sub
End Class