I have a string array, have splitted the values and now I want to convert the array to an int array so I can use.
The code I have tried is listed below; the filename = file_01_3001
bascially I want to get values 01 into a int variable and the 3001 int another int variable.
string[] sArray = fileName.Split('_');
MessageBox.Show(sArray[1] + " " + sArray[2]);
// int ledgerNumber ;
//int.TryParse(sArray[1], out ledgerNumber) ;
// int daybookNumber ;
// int.TryParse(sArray[2], out daybookNumber);
//int ledgerNumber;
//ledgerNumber = Convert.ToInt32(sArray[1]);
//int daybookNumber;
//daybookNumber = Convert.ToInt32(sArray[2]);
//MessageBox.Show(sArray[1] + " " + sArray[2]);
MessageBox.Show(ledgerNumber + " " + daybookNumber);
Dts.Variables["DaybookNumber"].Value = daybookNumber;
Dts.Variables["LedgerNumber"].Value = ledgerNumber;
MessageBox.Show(daybookNumber.ToString() + ":" + ledgerNumber.ToString());
Thanks