none
How to handle null value mapping in SqlDataSource RRS feed

  • Question

  • Hi, guys

    If I pass null value to a parameter of SQL automatically generated by SqlDataSource (as WHERE field1=@field1, where field1 is of type ntext or nvarchar) at design-time, it seems SqlDataSource can not update appricately, throwing an exception: [SqlException (0x80131904): The data types ntext and nvarchar are incompatible in the equal to operator.],

    even though the field1 in the db table is null-allowable.

     

    How do I handle the situation where I must pass null value to update any field permitting null value.

     

    Thanks,

    Ricky.

    Saturday, June 23, 2007 12:16 PM

All replies

  • What's the type of @field1, and what are you setting it to?  Post the relevant section of your code.
    Sunday, June 24, 2007 10:51 AM