MattWoberts
Programmer
Hi,
Please can anyone help - I am going mad!
I have a dataReader, and am itterating through it and building a string for each item. The datareader contains 2 columns, one is a number and the other is a text column.
My code was fine, but all of a sudden refuses to work - complaining about invalid casts. The code looks like:
sString = r.GetString(0) + " - " + r.GetString(1);
Is it really invalid to cast a Int32 into a string? Surely not? This code all seemed to work fine for me yesteray.
Also, I get errors on other areas in the code that work if I trace through them, but give an invalid CAST if I just hit F5 and allow the program to continue. Am I going mad?
Any help greatly appreciated!!!!
Please can anyone help - I am going mad!
I have a dataReader, and am itterating through it and building a string for each item. The datareader contains 2 columns, one is a number and the other is a text column.
My code was fine, but all of a sudden refuses to work - complaining about invalid casts. The code looks like:
sString = r.GetString(0) + " - " + r.GetString(1);
Is it really invalid to cast a Int32 into a string? Surely not? This code all seemed to work fine for me yesteray.
Also, I get errors on other areas in the code that work if I trace through them, but give an invalid CAST if I just hit F5 and allow the program to continue. Am I going mad?
Any help greatly appreciated!!!!