I keep getting the following error message:
"Input string was not in a correct format."
The Error message points to this line of code:
stadiumid = int.Parse(getfileNameUpdate[1]);
here is the full code:
public void AddStadiumsToDB(string[] stadiums, string donepath)
{
int stadiumid = 0;
foreach (string stadia in stadiums)
{
string[] getFileName = stadia.Split('\\');
string[] getfileNameUpdate = getFileName[getFileName.GetUpperBound(0)].Split('.');
string[] getfileupdate = getFileName[0].Split('{','}');
string movepath = donepath + getFileName[getFileName.GetUpperBound(0)];
string movepathUpdate = donepath + getfileNameUpdate[0];
stadiumid = int.Parse(getfileNameUpdate[1]);
addSpreadsheetDataToDb(stadia,stadiumid);
File.Move(stadia, movepath);
}
}
Any help would be appreciated
MOD EDIT: When posting code...USE CODE TAGS!!!
This post has been edited by JackOfAllTrades: 11 February 2011 - 04:28 AM

New Topic/Question
Reply




MultiQuote




|