Monday, March 12, 2012

How to handle null value mapping in SqlDataSource

Hi, guys

If I pass null value to a parameter of SQL automatically generated by SqlDataSource (as WHERE field1=@dotnet.itags.org.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.

What's the type of @.field1, and what are you setting it to? Post the relevant section of your code.

Labels: , , , , , , , , , , , , , , ,

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home