my code is this:

Me.Validate()
Me.CFTINVENTORYBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(CFTDataSet)

At first I can insert data into the cells and save it... but when i try to edit the same cell with data already saved in it I get this error...

sqlcelexception was unhandled
There was an error parsing the query. [ Token line number = 2,Token line offset = 29,Token in error = , ]

I also get the same error when deleting an already saved cell with data.

please help.

Recommended Answers

Please share your code. The portion you are sharing doesn't show much

Jump to Post

All 4 Replies

Please share your code. The portion you are sharing doesn't show much

I'm using a dataset with sql server compact3.5 in vb 2010...
I just dragged and dropped the table to my dataset designer then I added the dataset to my form... I'm just a beginner in vb programming.. please help..

here's the whole code:


Imports System.IO

Public Class CFTINVENTORYDATABASE


Private Sub CFTINVENTORYDATABASE_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

'TODO: This line of code loads data into the 'CFTDataSet.CFTINVENTORY' table. You can move, or remove it, as needed.
Me.CFTINVENTORYTableAdapter.Fill(Me.CFTDataSet.CFTINVENTORY)
Button2.Enabled = False
Button2.Show()

End Sub

Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
CFTINVENTORYBindingSource.AddNew()
Button2.Enabled = True
Button2.Show()

End Sub

Private Sub Button2_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

Me.Validate()
Me.CFTINVENTORYBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(CFTDataSet)


If Me.Validate = True Then
MsgBox("You have successfully added a new item to the CFT inventory")
ProductIDTextBox1.Clear()
NameTextBox1.Clear()
DescriptionTextBox1.Clear()
Price_1_15TextBox1.Clear()
Price_16_30TextBox1.Clear()
QuantityTextBox.Clear()

Me.Button2.Enabled = False

End If
End Sub

End Class

how can i update a data in datagrid view pls tell me!!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.