Hi
I'm sending a long string to a web service like this
field1,field2,field3,field4,field5,field6,field7+f ield1,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 5 1446
"Kenny" <an*******@discussions.microsoft.com> wrote in message news:97**********************************@microsof t.com... field1,field2,field3,field4,field5,field6,field7+f ield1,field2,field3,field4,field5,field6,field7...
do I have to use the String class' methods inside a Do-While or there is a more powerfull way to do it?
I'd use String.Split( ), first on '+' to get an array of rows; then on ',' to get an array of
the columnal values for each row. It's certainly the most straightforward, provided the
separators ('+' and ',') don't occur within the values.
The classes in the System.Text.RegularExpressions namespace could also be used,
but I think a regexp would be overkill.
Derek Harmon
Hi kenny,
I would do a split on the ","
It is typed here so watch typos and errors
\\\
Dim mytext() as string = mysendedstring.split(","c)
dim mysingletext as string
for each mysingletext in mytext
'dosomething
next
///
I hope this helps,
Cor Hi
I'm sending a long string to a web service like this:
field1,field2,field3,field4,field5,field6,field7+f ield1,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
* "=?Utf-8?B?S2Vubnk=?=" <an*******@discussions.microsoft.com> scripsit: I'm sending a long string to a web service like this:
field1,field2,field3,field4,field5,field6,field7+f ield1,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?
Have a look at the string's 'Split' method or the 'Strings.Split' method.
--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Kenny,
Why a delimited string as opposed to sending an XML Node or a DataSet?
With an XML Node you don't have to worry if one of your fields have either a
+ or a , in them.
With a DataSet you don't have to worry about parsing it into a DataSet!
As the others have pointed you can use Split to parse your input string.
There are three Split functions in .NET:
Use Microsoft.VisualBasic.Strings.Split if you need to split a string based
on a specific word (string). It is the Split function from VB6.
Use System.String.Split if you need to split a string based on a collection
of specific characters. Each individual character is its own delimiter.
Use System.Text.RegularExpressions.RegEx.Split to split based
on matching patterns.
Hope this helps
Jay
"Kenny" <an*******@discussions.microsoft.com> wrote in message
news:97**********************************@microsof t.com... Hi
I'm sending a long string to a web service like this:
field1,field2,field3,field4,field5,field6,field7+f ield1,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
Hi Jay B,
Missed you already
No need to explain.
:-)
Cor This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Galina |
last post by:
Hello
I am going to copy a data from MS Access table into Oracle table. One
of fields is memo type and data in this field range from 1 character
to 551 long string. Do I need to create a field...
|
by: William Payne |
last post by:
Hello, I have a variable of type unsigned long. It has a number of bits set
(with set I mean they equal one). I need to determine those bits and their
position and create new numbers from them. For...
|
by: Bryan Olson |
last post by:
The current Python standard library provides two cryptographic
hash functions: MD5 and SHA-1 . The authors of MD5 originally
stated:
It is conjectured that it is computationally infeasible to...
|
by: Seth |
last post by:
Ok, here is my setup. I have a fully functioning HTTP Handler
implemented. The handler is supposed to handle every single request
that comes in to a particular virtual directory. Thus, in IIS, I...
|
by: rsine |
last post by:
I have developed a program that sends a command through the serial port
to our business system and then reads from the buffer looking for a
number. Everything worked great on my WinXP system, but...
|
by: jeremygetsmail |
last post by:
I've got an adp (Metrix.adp) with a reference to another adp
(InteractSQL.adp). InteractSQL sits on a server, and is refered to by
all of the clients (Metrix), which sit on the client machines...
|
by: Slawomir Nasiadka |
last post by:
Hi,
I'am new to this group so I would like to say "Hello" everyone
and here is my problem:
I'm writing a simple application (code is at the end of this message) witch
would list all mails...
|
by: tutush |
last post by:
Hi there,
I have problem with importing my C++ code to C#.
The c++ looks like these
extern _declspec(dllexport) const char*
SendAndReceiveBufferedWrp(__int64 hConnection, const char*...
|
by: silvia.fama |
last post by:
Hi!
I'm using c language.
I need to copy a long type value into a char string using a memcpy
function:
memcpy(string, (long *) value, len)
this value will be then insert into a database.
On...
|
by: PengYu.UT |
last post by:
Hi,
In python, triple quote (""") can be used to quote a paragraph
(multiple lines). I'm wondering if there is any equivalent in C++.
For the following code, I could write the long string in a...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |