Here is my GetData mod
Private Sub GetData(ByVal selectCommand As String)
Try
Dim Cxx As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source= " & Application.StartupPath & "\zAdmin.mdb;User Id=admin;Password=;"
SQL = "Select LastName, FirstName, Date, Score from Scores"
' Create a new data adapter based on the specified query.
SxAdapter = New OleDbDataAdapter(SQL, Cxx)
Dim MyCommandBuilder As New OleDbCommandBuilder(SxAdapter)
Dim SxTable As New DataTable()
SxTable.Locale = System.Globalization.CultureInfo.InvariantCulture
SxAdapter.Fill(SxTable)
SxSource.DataSource = SxTable
Catch ex As OleDbException
MessageBox.Show("Error")
End Try
End Sub
"Arne Beruldsen" wrote:
When I go to update my datagridview...I get this error
Dynamic SQL generation for the UpdateCommand is not supported against a
SelectCommand that does not return any key column information.
using an update button...I have the following code:
Dim cm As OleDb.OleDbCommandBuilder = New OleDb.OleDbCommandBuilder(SxAdapter)
SxAdapter.Update(CType(SxSource.DataSource, DataTable))
I'm using 2005
Any ideas?