|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
if anyone can see whats wrong with this code they win a prize cos i cant see it..... All i am trying to do is insert a new row in a table. it goes into a dataset ok and displays fine in the grid but when i try to go past that i get an error in the OleDbCommandBuilder.
Private Sub cmdStart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdStart.Click Dim conn As New OleDbConnection() Dim DAFlexi As New OleDbDataAdapter("Select * from LoggedDetails", conn) Dim DSFlex As New DataSet() Dpath = "C:\Flexi Time" 'this assigns the connection string conn.ConnectionString = ConnectToDb() conn.Open() 'fill the data set with data from the table supplied DAFlexi.Fill(DSFlex, "LoggedDetails") DataGrid1.SetDataBinding(DSFlex, "LoggedDetails") Dim DRFlexi As DataRow = DSFlex.Tables("LoggedDetails").NewRow DRFlexi.Item("User") = Uname DRFlexi.Item("StartTime") = TimeOfDay DRFlexi.Item("FDate") = Today DRFlexi.Item("MachineName") = CName 'adds a row to the table supplied in the dataset DSFlex.Tables("LoggedDetails").Rows.Add(DRFlexi) If DRFlexi.RowState = DataRowState.Added Then MsgBox("ADDED") End If Dim OcommBuild As OleDbCommandBuilder = New OleDbCommandBuilder(DAFlexi) DAFlexi.Update(DSFlex, "LoggedDetails") 'DataGrid1.Refresh() conn.Close() conn = Nothing End Sub please give me some guidence ![]() |
![]() |
| Viewing: Dev Articles Community Forums > Programming > ASP Development > is ADO .NET mad or is it me being blind |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|