Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to update data to table from DataSet in VB.NET

Status
Not open for further replies.

NMickey

Programmer
Nov 7, 2004
15
US
Hi,

I got the Dataset from web service and I want to update/insert that Dataset into the local table in the Pocket PC. Can any one give some idea or code that can help me?

Any help would appreciate.

Thanks

 
You will need to write some kind of stored procedure or SQL code to make the changes in the table.

Christiaan Baes
Belgium

If you want to get an answer read this FAQ faq796-2540
There's no such thing as a winnable war - Sting
 
Hi chrissie1,

Thank you for your help. I think you're right that I must
create a stored procedure or SQL code to make it works. But I am stuck on that. Here I have so far. Please take a look a code below so you can see why it does not update in my table.


Dim dsItems As New Service1
Dim ds As DataSet
Dim myCommand As SqlCeCommand

ds = dsItems.ItemList()
Me.DataGrid1.DataSource = ds.Tables(0)
Me.DataGrid1.Refresh()

Dim myConn As New SqlCeConnection(ConnString)
Dim myDataAdapter As New SqlCeDataAdapter

myDataAdapter.SelectCommand = New SqlCeCommand("SELECT *
from Items", myConn)

Dim cb As SqlCeCommandBuilder = New SqlCeCommandBuilder(myDataAdapter)

myConn.Open()
myDataAdapter.Fill(ds, "Items")
myDataAdapter.Update(ds, "Items")
ds.AcceptChanges()
myConn.Close()

Thank you.



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top