Long String

K

Kenny

Hi

I'm sending a long string to a web service like this

field1,field2,field3,field4,field5,field6,field7+field1,field2,field3,field4,field5,field6,field7..

On the web service I need to read and to parse it in order to fill a DataSet and to update the DB,so do I have to use the String class' methods inside a Do-While or there is a more powerfull way to do it

Thks
 
J

Jan Tielens

Instead of passing a string value you could pass an array of strings. Then
you could walk through the array by using a foreach loop

string[] s = myWebservice.GetValue();
foreach(string item in s)
{
// do stuff
}

--
Greetz

Jan Tielens
________________________________
Read my weblog: http://weblogs.asp.net/jan


Kenny said:
Hi

I'm sending a long string to a web service like this:

field1,field2,field3,field4,field5,field6,field7+field1,field2,field3,field4
,field5,field6,field7...

On the web service I need to read and to parse it in order to fill a
DataSet and to update the DB,so do I have to use the String class' methods
inside a Do-While or there is a more powerfull way to do it?
 
R

richlm

.... or if you are committed to passing the data as a string, you can split it into an array in the WS using String.Split(...)
Check the .NET framework class library documentation on the String.Split method for a comprehensive example
(Of course you still need a loop to walk the resulting array).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top