DataSet update with Web Services
This is what my problem is right now...I used to do the SQL update in
a long and bad way... I am wondering who can leads me to a better way
to improve it by using TableMapping and Update.
Here's a simple structure of my table in my dataset(dsTemp)..
UserID - integer(unique key)
LastName - string
FirstName - string
Email - string
Phone - string
I used to apply the SQLDataAdapter to insert information into the
database by sending each item LINE by LINE from the server
like..(assuming I have a datadapter called da_user_select)
da_user_select.updateCommand.parameters.item(1).va lue =
da_user_select.updateCommand.parameters.item(2).va lue =
da_user_select.updateCommand.parameters.item(3).va lue =
da_user_select.updateCommand.parameters.item(4).va lue = tbemail.text
da_user_select.updateCommand.parameters.item(5).va lue = tbphone.text
Catch ex as Exception
everything works fine here... but I am trying to learn a better way to
do it by using Web Services. I know that I need to put these
information into the dataset and send them thru the WebService,
however, when the Web Service receives the dataset, I wasn't able to
update the information....here's something that I want to do, please
modify and let me know what the problem is..
<WebMethod()> Public Function fcnReturn_updateOK(ByVal dsSet As
DataSet) As String
Dim sResult As String
Dim drr As DataRow()
' here i just try to select all rows from the dataset I sent from the
server, any better way to modify this?
drr = dsSet.Tables("sp_user_select").Select("")
' Do I need something like tablemapping here?
' this is the only line i put here to update, I think there should be
a better way to use this without assigning parameter one by one, but I
am not sure how to do this, please help
Catch ex As Exception
I am trying to simplfy the way that I used to assign paramaters from
the dataset to the dataadapter, what is the best method? Thanks a
lot!!!! Hope my codes are "understandable".
|All times are GMT. The time now is 10:44 PM.|
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.