M
Michael Lang
I am using the standard "pubs" database.
Errror.ToString() --
"System.Data.SqlClient.SqlException: The text, ntext, and image data types
cannot be compared or sorted, except when using IS NULL or LIKE
operator.\r\n at System.Data.Common.DbDataAdapter.Update(DataRow[]
dataRows, DataTableMapping tableMapping)\r\n at
System.Data.Common.DbDataAdapter.Update(DataSet dataSet, String
srcTable)\r\n at System.Data.Common.DbDataAdapter.Update(DataSet
dataSet)\r\n at Pubs.Data.titlesDB.Update() in
e:\\projects\\vs7\\pubsexample\\data\\titlesdb.cs:line 194"
This Occurs when I update the database...
DataAdapter _da; DataSet _ds;
....
_da.Update(_ds);
When I check the database, nothing has been updated. So the "compare or
sort" operation is happening before the update.
The DataSet has 1 "Modified" record. I changed a single field value on
field "6" below. These are the field values from the locals window for the
"Modified" DataRow.
[0] "BU1032" string
[1] "The Busy Executive's Database Guide" string
[2] "business " string
[3] "1389" string
+ [4] 19.99 System.Decimal
+ [5] 5000 System.Decimal
+ [6] {11} System.Int32
+ [7] {4095} System.Int32
[8] "An overview of available database systems with emphasis on common
business applications. Illustrated." string
+ [9] {6/12/1991} System.DateTime
Some other records have null field values, but they were null before the
update, and they are not modified records. here is the locals window values
for one of those DataRows
[0] "PC9999" string
[1] "Net Etiquette" string
[2] "popular_comp" string
[3] "1389" string
+ [4] {System.DBNull} System.DBNull
+ [5] {System.DBNull} System.DBNull
+ [6] {System.DBNull} System.DBNull
+ [7] {System.DBNull} System.DBNull
[8] "A must-read for computer conferencing." string
+ [9] {7/25/2003} System.DateTime
What is trying to "compare or sort" the records as the error states? The
DataAdapter?
Michael Lang, MCSD
Errror.ToString() --
"System.Data.SqlClient.SqlException: The text, ntext, and image data types
cannot be compared or sorted, except when using IS NULL or LIKE
operator.\r\n at System.Data.Common.DbDataAdapter.Update(DataRow[]
dataRows, DataTableMapping tableMapping)\r\n at
System.Data.Common.DbDataAdapter.Update(DataSet dataSet, String
srcTable)\r\n at System.Data.Common.DbDataAdapter.Update(DataSet
dataSet)\r\n at Pubs.Data.titlesDB.Update() in
e:\\projects\\vs7\\pubsexample\\data\\titlesdb.cs:line 194"
This Occurs when I update the database...
DataAdapter _da; DataSet _ds;
....
_da.Update(_ds);
When I check the database, nothing has been updated. So the "compare or
sort" operation is happening before the update.
The DataSet has 1 "Modified" record. I changed a single field value on
field "6" below. These are the field values from the locals window for the
"Modified" DataRow.
[0] "BU1032" string
[1] "The Busy Executive's Database Guide" string
[2] "business " string
[3] "1389" string
+ [4] 19.99 System.Decimal
+ [5] 5000 System.Decimal
+ [6] {11} System.Int32
+ [7] {4095} System.Int32
[8] "An overview of available database systems with emphasis on common
business applications. Illustrated." string
+ [9] {6/12/1991} System.DateTime
Some other records have null field values, but they were null before the
update, and they are not modified records. here is the locals window values
for one of those DataRows
[0] "PC9999" string
[1] "Net Etiquette" string
[2] "popular_comp" string
[3] "1389" string
+ [4] {System.DBNull} System.DBNull
+ [5] {System.DBNull} System.DBNull
+ [6] {System.DBNull} System.DBNull
+ [7] {System.DBNull} System.DBNull
[8] "A must-read for computer conferencing." string
+ [9] {7/25/2003} System.DateTime
What is trying to "compare or sort" the records as the error states? The
DataAdapter?
Michael Lang, MCSD