Help with ..FAILED TO CONVERT PARAMERTR VALUE FROM STRING TO INT32

  • I have a table with different columns ( CourseCode int, title nvarchar,creditHour int...) courseCode as aprimary key.

    I am using ASP.NET , C# and MS SQL .

    my problem is , when I send empty text box to CreditHour, it generates an error wchih says FAILED TO CONVERT PARAMERTR VALUE FROM STRING TO INT32. But when I give vale for the text box it works fine.

    I tried a lot but not sucessful. please help me..........

  • Don't pass "" to a parameter of sqlDbType.int ... instead convert it to System.DBNull.Value and you'll be fine.

    I don't remember my C# enough to know what happens if you try to convert "" to an int type so you may try that and see if it works.

    └> bt



    Forum Etiquette: How to post data/code on a forum to get the best help[/url]

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply