I have a page set where i get data in following format
41128°°8/20/2007 12:00:00 AM°11:00°True
These data are stored in an arraylist name d. Then i use following code to split the data
when i display the data string shid i get the value 41128. But when i try to use Int32.Parse to convert the value to an integer i get an error Input string was not in correct format. The code is
After getting the input string error. I used .Trim() removing any form of spaces but still i get the same error. Please advice.
41128°°8/20/2007 12:00:00 AM°11:00°True
These data are stored in an arraylist name d. Then i use following code to split the data
Code:
ArrayList d = new ArrayList();
d = x.GetDataList(); //x is a class ; GetDataList returns data as Arraylist
//manipulating data
string data = d[0].ToString();
char deli = '°';
string[] load = data.Split(deli);
string shid = load[0].ToString();
string pnum = load[1].ToString();
string pdate = load[2].ToString();
string ptime = load[3].ToString();
string pfcfs = load[4].ToString();
Code:
lblerr.Text = Int32.Parse(shid);
Comment