Tracking Forums, Newsgroups, Maling Lists
Home Submit Tracker Forums
  Advanced Search


VS 2005 Parse A Comma Delimited String?

Is there a way to easily split a comma delimited string into variables (or table fields), example:

PHP Code:Feed.SmulocV2.Equipment,CAT,,DFT08783,2567,Hours,2010-02-07 06:37:41,Lat:38.025921,Lng:-88.776733

View 5 Replies (Posted: Mar 8th, 2010, 01:30 PM)

Sponsored Links:

Related Forum Messages For ASP.NET category:
Comma And Dash Delimited String?
i have a string variable which contains comma and dash separated data


i want to convert it to array of continous values like;


how can i do this?

Posted: Nov 23, 2009 03:54 PM

View 8 Replies!   View Related
Web Forms :: ArrayList To Comma Delimited String?
I have an ArrayList object with x String elements in it. I would like to convert the ArrayList to a comma delimited String without using an iterative loop. Does anyone know of an easy way to do this?

Posted: May 14, 2007 03:54 PM

View 4 Replies!   View Related
Populate Comma Delimited String To Checkboxlist?
I have a problem to populate a comma delimited string to a checkboxlist inside gridview edittemplate. I want to retrieve the value of the checkboxlist first then use gridview rowdatabound event to split the "," and display the selected value. But how do I retrieve the value of the checkboxlist inside gridview? IMy code is as below:

protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{CheckBoxList c = (CheckBoxList)GridView1.FindControl("chkAchieved");
string commastring = ???? //checkboxlist selectedvalue, it will be a commadelimited string. but How?
char sep = ',';
String[] s = commastring.Split(sep);
for (int i = 0; i < s.Length; i++)
for (int j = 0; j < c.Items.Count; j++)
if (c.Items[j].Value == s[i])
c.Items[j].Selected = true;
<asp:CheckBoxList ID="chkAchieved" runat="server" Font-Size="Smaller"
selectedValue='<%# Bind("achieved") %>' //---------selectedvalue is a comma delimited string from database
<asp:ListItem> training</asp:ListItem>
<asp:ListItem> teaching</asp:ListItem>

Posted: Dec 03, 2009 06:25 PM

View 11 Replies!   View Related
Validating Email Address In Comma Delimited String?
i have the following which sends email addresses which have been inserted into a textbox. How do i go about validating it to ensure the email addresses are correct. This is what i have done so far;


Posted: Sep 13, 2009 04:47 PM

View 9 Replies!   View Related
How To Retrieve A Comma-delimited String Of Values From A Text Box
I have a textbox AND 3 checkboxes; checkbox1, checkbox2, checkbox3

In textbox we have 1,2,3

If I type in textbox1 = 1,2 then

checkbox1 and checkbox2 will be checked and checkbox3 will remain unchecked.....

How to do this in

Posted: Nov 3 10 at 18:37

View 3 Replies!   View Related
State Management :: How To Build Comma Delimited String Of Those Values And Stick Them Into A Session Variable
I have this code that loop through table controls how do stick the seleted information into asession variable. Then i have to pass it into another page table control.example code


Posted: Feb 11, 2011 12:17 PM

View 7 Replies!   View Related
SQL Server :: Looking For Comma Delimited List In A Field
How can I return a comma delimited list of codes for each client, to a temp field in the results of a select statement in a stored procedure?

Is it posible to get a comma delimited list into a temp field of a temp table?

I have a table tblCodes that has the following fields ClientID, CodeID

I have a table tblCodeLookup that has the following fields CodeID, CodeDecription

I need to get a temp table with two fields ClientID and a field that holds a comma delimited list of CodeDescriptions for each clientID. Maybe the tmp fiel would be named ClientsCodes Select clientID, ClientsCodes

Posted: Nov 11, 2010 05:34 PM

View 6 Replies!   View Related
SQL Server :: How To Read Comma Delimited Data From A Column
I am creating a BLOG and Forum, and am using tags similar to this and most other sites, I just need to know how to retrieve the tags from a culmn if the tags are stored with commas separating them, I am sure I read about it somewhere but was unable to find the column wouldbe:

tag1, tag2, tag3, etc.....

I would need to be able to:

1. Store tags, and add-on to tags already in the column

2. retrieve the tags as a list, or separately

Posted: Feb 23, 2011 02:02 PM

View 5 Replies!   View Related
.net - Fails To Correctly Handle Comma Delimited Cookies?
According to the RFC, individual cookies in the "Cookie" HTTP header may be separated by commas as well as by semicolons. However, ASP.NET does not parse the commas case correctly - it does not count comma as a separator, but considers it just part of the value.

For exampleIf a client sends header Cookie: a=b, c=d, then the ASP.NET application will see just one cookie named "a" with value "b, c=d".As a special case, the same thing happens when the client sends several Cookie headers (one for each cookie) instead of combining all cookies in one header. From HTTP perspective, this is completely valid, and in such case the effective value of the header should be concatenation of the values of all its instances separated by commas.Does anybody know a workaround (or maybe a fix?) for this? I absolutely need to get this working, because I don't control the client.P.S. It is ironic that, according to this thread, the .NET built-in HTTP client's (aka HttpWebRequest) behavior is just the opposite, and also causes problems. :-)

Posted: Mar 6 10 at 23:53

View 3 Replies!   View Related
Web Forms :: How To Handle SQL Column With Multiple Comma-delimited Values
I've inherited an SQL table with a columnnamed "product_codes." It contains 1 or more 4-digit numeralsseparated by commas (for example, the first record in the table has this in the "product_codes" column:0010,0810

There's a second table containing those product_codes and their corresponding namesin a column called "product_name"

I'm trying to set up a FormView that will display an individual record and allow the user to update the record. But when attempting to display a record that has multiple values in the "product_codes" column I get an error, presumably because it can't map the product code to the product name.


Posted: Jan 25, 2011 04:31 PM

View 8 Replies!   View Related
Web Forms :: How To Handle Comma Delimited Textbox Email Addresses
I want to give people the option of entering multiple email addresses in amultiline textbox or textareathat are separated by commas. how to get the list into an array, then validate each email address, then process each email.

Posted: Aug 12, 2010 02:00 PM

View 3 Replies!   View Related
Best Method To Attach Or Import Data From A Comma Delimited File To Access?
I have a project I am working that requires me to go to an FTP port and copy a file to the local machine... so far so good... the next step is to take the comma delimited file and import the records (rows) into a local Access database...

Should I be looking the Attach method in Access? To attach and dump all the data in one shot?

OR To open the file with StremRead and process each row one at a time?

I am using VS2008, C#, .NET 3.5, Access 2007... once in production there could 20 - 30 thousand records to be appended to the DB then normalised.

Posted: Nov 15, 2010 06:43 PM

View 9 Replies!   View Related
SQL Server :: How To Combine Multiple Rows Into A Comma-delimited List In Sql Server In Build Function
How can I combine multiple rows into a comma-delimited list in sql server in build function?? in HCL

examples :


Output : 12, 15, 18, 20

with in build function of sql server.

Posted: Jan 10, 2011 08:37 AM

View 6 Replies!   View Related
C# Split Function - Splitting String Delimited Files
I am having problems with the .split function.

token_list = line.Split(',');

My input data is a CSV file that contains numbers and strings totaling 5 columns. The strings are string delimited...

1, 2, "Test", 1, "Test" 5 columns
1, 2, "Test", 1, "Test" 5 columns
1, 2, "Test, Test", 1, "Test" 6 columns!!
1, 2, "Test", 1, "Test" 5 columns

The split function as it is written above is splitting the third line into 6 columns because there is a comma in the data. Is there a way for me to tell the split function to ignore commas in strings?

Posted: Jun 19, 2010 12:15 AM

View 1 Replies!   View Related
Trim Comma From String
I have following string

testString = "A,B,C,D,,,"

i want to remove last comma / or commas using trim funcality only using C# for

Posted: Jun 09, 2009 07:05 PM

View 1 Replies!   View Related
Check Comma Separated String Contain More Than 1 Different Value?
Is there a faster way to check is a comma seperated string contain more than 1 diffrent value?

str = "String1, String2, String1"

I want the above str to return TRUE as it contain 2 different value. How can I do that?

Posted: Jan 18, 2010 08:09 AM

View 8 Replies!   View Related
Use Comma - Hyphen - Apostrophe In String?
I reading a string. That string is Name like Johnny. If this "Johnny" contains comma, hyphen or apostrophe, I have to throw a error. I m able to read, if that string has numeric data. but I m unable to read this

Posted: Mar 12, 2010 01:29 PM

View 7 Replies!   View Related
Get Last Element From Comma Separated String?
I have a string like this "abc, def, ghi, jkl," . and items like "mno, pqr," could be added dynamically later.I'm stucked on how to get the last item without the ",". e.g. return "jkl" or "pqr" which ever is the last.

Posted: Mar 29, 2010 02:36 AM

View 6 Replies!   View Related
Replacing Last Comma In String With Different Character
i have a string, and i want to replace the last comma with something else. For instance this is my string;

"Monday, December 6, 9:00 PM"

How do i replace that last comma so it can look like this;

"Monday, December 6 2010 9:00 PM"

Posted: Oct 23, 2010 02:04 PM

View 4 Replies!   View Related
Web Forms :: Trim Comma From End Of String?
I'm trying to trim a comma from the end of a string. I've tried the following:


I've also tried:

char[] CharToTrim = { ',' };

Neither option is working. why?

Posted: Mar 07, 2011 11:41 PM

View 4 Replies!   View Related
Web Forms :: Remove Last Comma At End Of String?
I have a loop that writes out a comma separated value list in a label control, and I want to remove the last comma of the list and write a stop '.', but to start with I can' t remove that comma. I tried:

Dim c_gest As SqlDataReader = CmdOffer.ExecuteReader()
While c_gest.Read()
cert_gest.Text() &= c_gest("Certificate_name") & ", "
End While
cert_gest.Text().TrimEnd(", ")

But it doesn' t work, nothing happens and the last comma continue there. How can I do it?

Posted: Sep 08, 2005 03:36 PM

View 19 Replies!   View Related
Good Way To Parse Query String?
I have a String that contains the following: ?workarea=London+&+Home+Counties+Ltd&sub=fs&&&FASh*5which resembles a URI query string. What is the best way to parse the elements of this string (workarea and sub) without messing about with string manipulation?If I use HttpUtility.ParseQueryString is gets stuck as both elements include &. However if I encode the whole thing first I lose the seperations of the elements. Ideally the output would be:workarea = London & Home Counties Ltdsub = fs&&&FASh*5

Posted: Jan 10 at 11:51

View 4 Replies!   View Related
Parse String And Update Its Content?
I have a string which looks something like this:

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque
RecordID:103017 pretium iaculis venenatis. Phasellus RecordID:103017 vestibulum scelerisque fringilla.

I need to parse through my string, pull out the record id, do a query based on this ID and then over write the full RecordID:n with the result of my query.

I'm totally stumped on how to do this, i could also do it in TSQL

Posted: Oct 27, 2009 03:11 PM

View 5 Replies!   View Related
Return Array From Comma Separated String?
Suppose I have the string like String sample="{K,S},{T}". Then splitting with"," I need the output of the string array. The string array is having items {k,S}, {T}. how to split the above string with "," separated.

Posted: Mar 08, 2011 12:57 PM

View 7 Replies!   View Related
Convert List To Comma Separated String?
How do I convert:

dim myList as list(of integer)

to a comma separated string?

Posted: Feb 05, 2008 08:48 PM

View 4 Replies!   View Related
Split String And Make Comma Separated?
I have the following string, is it possible to split seperate & make as comma seperator string by 'and', 'or' and 'not' operators. "Application AND for Payment OR John OR Smith OR Ralph Doe NOT Bob NOT Ad Hock" and assign to the following variables:

sAndOperator = 'Application', 'for Payment'
sOrOperator = 'John', 'Smith', 'Ralph Doe'
sNotOperator = 'Bob','Ad Hock'

Posted: Feb 09, 2011 10:00 AM

View 5 Replies!   View Related
Create Binding From Comma Separated String?
Normally when I want to loop through something, I would have a repeater and bind a dataset (or something) to the repeater. My situation this time is somewhat different, I have a string of comma separated values and I need to somehow bind this to a repeater.

Posted: Oct 2, 2009, 00:37

View 5 Replies!   View Related
Crystal Reports :: Trim The String After The First Comma?
I developed crystal report using the tool available with VS2005.

I need help for extracting a string in a formula field.

Example :

String= CFG:1,132578992,1958| result should be 132578992

String= CFG:2,158974,1953| result should be 158974

in the string always starting part is "CFG" and ending part is "|" how can i trim the string after the first comma .

Posted: Aug 01, 2010 07:28 PM

View 2 Replies!   View Related
SQL Server :: Replace The String After Comma Starts In MS SQL?
How to replace the remaining String after the Comma Starts Using SQL Query. Below is the data

"MediaRights, MediaRightsLink, MediaRightsCompanies, MediaRightsTypes"

Posted: Sep 23, 2010 03:16 PM

View 2 Replies!   View Related
Web Forms :: Add Value To End Of The String That Has Comma Separated Text?
I would like to accept the value from textbox and then add that value to database field which have comma separated value stored in it.

Posted: Dec 21, 2009 03:49 PM

View 1 Replies!   View Related
Parse The String That Has Html Break Line Tag ()?
Can anyone shows me a way to parse the string that has the html break line tag? I want to get the value inside the <br>.....</br>, how do I do it?

string WResponse = <br>Report download completed</br><br>Report preparation completed</br><br>Report inserted to queue</br>

Posted: Nov 05, 2008 07:51 PM

View 11 Replies!   View Related
How To Parse A String That Lacks Delimiters To A DateTime Using C#
I have, somehow, this string available "20100205 162206". This is a date and time without any delimiter char. I need this back as a DateTime in C#. What is the best way?

Posted: Feb 8 10 at 17:28

View 1 Replies!   View Related
Web Forms :: Method To Parse A String In To Sub Strings?
Given a string like:

Token A^*!%~Token B^*!%~Token C^*!%~Token D^*!%~Token E

Write a method that parses the string into a series of substrings where the delimiter between the substrings is ^*!%~ and then reassembles the strings and delimiters into a single new string where each of the substrings is in the reverse order from the original string. The method must return the final string. The expected output would be:

Token E^*!%~Token D^*!%~Token C^*!%~Token B^*!%~Token A

Posted: Aug 03, 2010 07:01 PM

View 2 Replies!   View Related
String Manipulation / Instead Parse Out Last Backslash And Get Filename?
IfI have afile in a path lke this:

C:demo estfile.txt

I cana split function and split on the backslash character to get the pieces. But if my directory could change thiswouldn't work. So how would Iinstead parse out the last backslash and get the filename that wayso thatit wouldn't matter if the path changed?

Posted: Sep 23, 2010 07:16 PM

View 2 Replies!   View Related
Add Data To Gridview In A Loop With Comma Separated String

I am trying to add data to gridview in a loop with comma separated string. But everytime gridview remove previous data and bind only with last id. i want to plus record in gridview with every loop.

Posted: Dec 3 09

View 1 Replies!   View Related
DataSource Controls :: How To Convert String (comma Separated) To Int
I'm having a listbox on the front end webform with multiple selection, after user selecting multiple items, i'm capturing the DataKeyValue of listbox(which is amenity_id of bigint) and looping all the selected items to a string with comma sepearated values. For example if user selects first 4 options, my output string will be like this (1,2,3,4) and i'm passing this as a string type to my data access layer and then to my below stored proc. I'm geting this error while inserting.. i know that my data type is of bigint and i'm trying to insert string type. i need to convert the string type to INT type and insert data. below are my stored procs:


This is where i'm splitting the comma seperated values and inserting them into table.

Posted: Mar 01, 2010 01:32 PM

View 7 Replies!   View Related
DataSource Controls :: Use WHERE In With Comma-separated String Of Integers?
BeenGoogling about this for a couple of hours but haven't hit on thesolution yet. This is an ASP.NET 3.5 app connecting to an MS SQL 2008 backend. The app uses a strongly typed dataset with ad hoc queries in table adapters. The object data source on the markup page will have one parameter that will accept a string of comma separated IDs. I need to feed that list of IDs to the WHERE clause in a query to pull each of the specified records. This is trimmed down version of the query:


Posted: Feb 07, 2011 09:57 PM

View 2 Replies!   View Related
C# - Putting Datatable Comma Separated Values In A String?
My datatable consists of a column named "ID". The no. of values in this column varies.Sometimes this Datatable fetches 3 IDs in that ID column, sometimes 2. Now if for example, my datatable has three values as 1,2,3. What I want is to put these three values in a string and separate them by commas as folows:-

string test= "1,2,3";

If Datatable has 2 values, then string should be as follows:-

string test= "1,2";

I did try but in vain.


DataTable dt=new DataTable;
dt = obj.GetIDs();
for (int i = 0; i < dt.Rows.Count; i++)
string test= "What should be here????";
edit 2
foreach(DataRow dr in dt.Rows)
string str = str + "," + Convert.ToString(dr("ID"));

@Rajeev ::Tried says dr is a variable but used as a method. What's wrong?

Posted: Feb 4 at 13:03

View 4 Replies!   View Related
Copyright 2005-08, All rights reserved