I ahve a custom module that loads user entered data to the database. The table was using a autogen number for the ID, but I changed it because I didn't want the numbers to be in sequence. So I assigned a random generated number to it before the Add method is called. Using the generated number I get...
DotNetNuke.Services.Exceptions.ModuleLoadException: Input string was not in a correct format. ---> System.formatException: Input string was not in a correct format. at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberformatInfo info, Boolean parseDecimal) at System.Number.ParseInt32(String s, NumberStyles style, NumberformatInfo info) at System.Int32.Parse(String s)
If I change the field back to an identity field, the add method works fine. Am I missing something here. Oh, btw, the field is the primary key for the table.
I the field was a long in the db and parsed to long in the code. I changed it to a nvarchar in the db and string in the code. The only thing that get's rid of this error, is to add the identity back.
Please help. I am out of ideas.