Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multi Value Separator with .net C#

Tags:

c#

universe

When we use C# with the Universe database the multi values are coming from the Universe Database as comma separated values to the programming site. Normally in Pick Basic language programming they come up as a ^252 or ^253 separated values. Therefore we can split the multi value easily with value separators because people don’t use the ^252 or ^253 in normal data entries.

But in C# when we select multi values from the Universe database they comes up with comma separated. If the multi value data actually contains a comma then we can’t use the comma value(,) as a value separator. Because this will split the multi value data in the wrong position.

For example if the multi value data is :

01 Although , we will do , Tom goes there , I will come down

The multi value for the above record are separated by a comma in the .net programming. But the first value(in bold) actually contains a comma after the “Although”.

We are facing problem to use the C# Split function to separate the data and get the individual values. Could you tell us how can we can overcome this in C# orVB.net programming with Universe database and get the individual values/sub values? .

Thank you.

like image 305
Explorer Avatar asked Oct 16 '13 02:10

Explorer


1 Answers

In general field delimiters are required precisely for the problem you are describing. If you use " you will then also need to decide what to do when your data inside a field also holds a " in it.

When you have found a good field delimiter (one with small memory foot print and that your data is not likely to contain). You can create a regular expression to grab the data from each field.

Like others have said, some code snippets or samples will mean that answers are more accurate and helpful.

Is there anyway you can bring the data back into a specific Type, for example MS DataTable or your own structure? List, where Row is a Type you create to store all possible fields in your specific data model?

like image 116
yonsk Avatar answered Nov 14 '22 22:11

yonsk