I've been working on this very simple problem for days. I really don't know what's wrong. I have an insert statement that saves the Category Code, Call Number, and other details of a book to an SQL Server Database. The code is found below. The bold font is the one having the problem.
neither the code, nor the stored procedure has an error. The only problem I have is that the Category Code of "CHM" for instance, is reduced to a single character "C". The same thing happens with all other category codes that were inserted. Only the first character is saved. This is odd, because the Call Number, which has the same data type and string length, does not suffer the problem. It is saved with an intact 3 number of characters in the database. I left a breakpoint on the part that captures the content of the string variable CategoryCode, and it clearly contains a total of 3 characters. I also executed the stored procedure directly in the database, and it's also saving 3 characters. However, when ASP.NET connects to the database using that stored procedure, it always save a single character for category code.
I really don't know why this is happening. I am really hoping that you could help me. :(
Thank you so much in advance.
View Complete Post