PDA

View Full Version : lỗi "The data types ntext and nvarchar are incompatible in the equal to operator." update xài tool



duongvannam
08-11-2011, 15:14
Viết code asp.net xài C# em xài listview có chức năng tự động insert,update,delete rất dễ. CỘt tomtat trong database em lưu dưới dạng nvarchar.Em xài tool thì có thể delete,insert được nhưng không thể update,Báo lỗi như trên:
"The data types ntext and nvarchar are incompatible in the equal to operator."

Xem code của cái SqlDataSource thì phần update là

UpdateCommand="UPDATE [gioithieu] SET [tomtat] = @tomtat, [gioithieu] = @gioithieu WHERE [idgioithieu] = @original_idgioithieu AND (([tomtat] = @original_tomtat) OR ([tomtat] IS NULL AND @original_tomtat IS NULL)) AND (([gioithieu] = @original_gioithieu) OR ([gioithieu] IS NULL AND @original_gioithieu IS NULL))">

sửa thế nào ạh?

có ai giúp em xin cám ơn

Nhân tiện có thể cho quá trình trên bằng Ajax đc ko?cám ơn