locked
Pass Integer data type to store proc RRS feed

  • Question

  • User589052352 posted

    Hi,

    I have int datatype declared in my store proc.

    When I try to pass parameter from code behind in sqldatasource as :

    SqlDataSource3.SelectParameters.Add(ContactNum", System.TypeCode.Int32, "1")

     

    I get error "

    Error converting data type nvarchar to int. "

     

    Any help

    Friday, December 31, 2010 8:17 PM

Answers

  • User-2139489267 posted

    Yes but still getting that error. 

    Try this

    SqlDataSource1.SelectParameters.Item(0).DefaultValue = value

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, December 31, 2010 11:27 PM

All replies

  • User-1892736467 posted

    Have you tried this:

    SqlDataSource3.SelectParameters.Add(ContactNum", DbType.Int32, "1"); 

    Friday, December 31, 2010 9:36 PM
  • User589052352 posted

    Yes but still getting that error. 

    Friday, December 31, 2010 10:26 PM
  • User-2139489267 posted

    Yes but still getting that error. 

    Try this

    SqlDataSource1.SelectParameters.Item(0).DefaultValue = value

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, December 31, 2010 11:27 PM