How to send a datarow to a webservice in VB.NET

I have a datarow which contains all the web form data values and I want to submit to a webservice in VB.NET and in  VS 2005.

Who is Participating?
armoghanConnect With a Mentor Commented:
Datarow cannot be send directly.

What i do is make a dataset and add a table and then add row in it.

some thing like

dim ds as new DataSet
' ds.EnforceConstraints = false
ds.Tables.Add( rowToSend.Table.Clone())

then send ds

This is the case when you have made webservice yourself.. and it has a method which takes dataset

Fernando SotoRetiredCommented:
Can you post the signature of the web method you are trying to use to send this data?
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

DataRow can't be sent to or received from a Web Service because the DataRow object isn't Serializable. Neither is the DataTable object for that matter.

The only way to do it is to pass a DataSet (which is Serializable) that contains a DataTable with DataRow objects in the DataTable.

The odd thing here is that the DataSet is made up of DataTable objects which are themselves made up of DataRow objects. When I first learned about this behavior, I thought it was wierd that MS designed the objects in this way. But, that's how it is.
vmandemAuthor Commented:
I really appreciate all your inputs. I will go ahead with the plan of creating datatable.
I will let you know how it goes, until then I will open up this question for more comments.

Thanks Again

vmandemAuthor Commented:
Every one gave good answer but would like to go with the first one.

Thanks All
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.