vb Code:
Public Sub Events_Edit() With frmEvents 'DefineConnection(ClassName) Adapter.UpdateCommand = New OleDbCommand("UPDATE [Events] SET [Date] = @Date, [EventName] = @EventName, [EventDesc] = @EventDesc WHERE [CIndex] = @CIndex") With Adapter.UpdateCommand .Connection = Connection Connection.Open() .Parameters.Add("@Date", OleDbType.VarChar, 150, "Date") .Parameters.Add("@EventName", OleDbType.VarChar, 100, "EventName") .Parameters.Add("@EventDesc", OleDbType.VarChar, 255, "EventDesc") .Parameters.Add("@CIndex", OleDbType.Integer, 5, "CIndex") End With Adapter.Fill(DS) Dim DRow As DataRow DRow = DS.Tables(0).Rows(.CMBIndex) CalStartRange = .monthCal.SelectionRange.Start.ToShortDateString CalEndRange = .monthCal.SelectionRange.End.ToShortDateString DRow.BeginEdit() DRow("Date") = "Start: " & CalStartRange & " " & "End: " & CalEndRange DRow("EventName") = .txtName.Text DRow("EventDesc") = .txtDesc.Text DRow.EndEdit() Adapter.Update(DS) DS.AcceptChanges() frmOverview.lstEvents.Items.Item(.cmbEvents.SelectedIndex).Text = CalStartRange & "-" & CalEndRange & ": " & .txtName.Text .cmbEvents.Text = .txtName.Text Events_LoadToCombo() Connection.Close() End With End Sub
ERROR:
Column 'Date' does not belong to table Table.
How do I fix this error?
Hows its being called: When I call the Edit Event, and fill in my information, I get the above error. and it highlights to:
DRow("Date") = "Start: " & CalStartRange & " " & "End: " & CalEndRange
So why am I getting this error and how can I fix it ?




Reply With Quote