vb Code:
If txtName.Text = "" Then MsgBox("You need to fill out your name") Exit Sub End If Try ''This code is doing my head in'' Dim objRow As DataRow Dim tableName As String = "highScore" Dim objDataSet As New DataSet dbConnection = New OleDb.OleDbConnection(ConnectionString) dbAdapter = New OleDb.OleDbDataAdapter("SELECT * FROM " & tableName & "", ConnectionString) Dim NewCommand = New OleDb.OleDbCommandBuilder(dbAdapter) dbAdapter.FillSchema(objDataSet, SchemaType.Source, tableName) dbAdapter.Fill(objDataSet, tableName) objRow = objDataSet.Tables(tableName).Rows.Add Dim rowNum = objDataSet.Tables(tableName).Rows.Count objRow = objDataSet.Tables(tableName).Rows.Find(rowNum) objRow.Item(0) = rowNum objRow.Item(1) = txtName.Text objRow.Item(2) = myTotalScore dbAdapter.Update(objDataSet, tableName) Catch ex As Exception MsgBox(ex.Message) End Try
Ok this works and anyway thanks for the helps folks




Reply With Quote