Error, "The data types text and nvarchar are incompatible in the equal to operator"

Hi, i have a table in sqlexpress named Contacts:

ID   (int)   -primary key-

name   (varchar(30))

lastname   (varchar(30))

phone   (varchar(15))

fax   (varchar(15))

desc   (text)

In my default.aspx page, i have a GridView that has the conecction to this table. The GridView has the Editing and Deleting checkbox enabled but my problem is that i can't edit or delete any row when the page is running and the massage is this: "The data types text and nvarchar are incompatible in the equal to operator"

It would have to work, but i don't know what happen, Please, any help!

0
Bullanguero
1/3/2006 8:50:56 PM
asp.net.sql-datasource 29906 articles. 0 followers. Follow

8 Replies
936 Views

Similar Articles

[PageSpeed] 26

Handling TEXT datatypes is slightly different than regular columns. You cannot do a regular UPDATE/INSERT with TEXT column. Read up BOL for more info.

***********************
Dinakar Nethi
Life is short. Enjoy it.
***********************
0
ndinakar
1/4/2006 1:56:10 AM
Change desc from text to varchar(max) and your issue should go away.
0
Motley
1/4/2006 6:48:34 AM

Ok, but what is BOL?

0
Bullanguero
1/4/2006 2:43:29 PM
Books On Line (The documentation/help)
0
Motley
1/4/2006 5:46:37 PM
Thank you Motley, now i can update and delete whit that change in the data type.
0
Bullanguero
1/5/2006 3:35:48 PM
Bullanguero wrote:
Ok, but what is BOL?


Books Online is a great free SQL Server reference from Microsoft. You can download it and install it locally or you can access it online:
    Downloadable verson of Books Online
    Online version of Books Online


Terri Morton
Engagement Manager, Neudesic

How to ask a question

0
tmorton
1/5/2006 4:26:47 PM

ok, i have the same problem!!!!!

i changed text to vchar(max).

i dont get an error any more. but the update doesnt work either!!

i am using TINYMCE to add functionality to the textbox. when i press update it does back to view mode but ignores my alterations.

 

if i dont use the TINYMCE editor on the text box everything works fine.


regards,

Pauly

The true sign of intelligence is not knowledge but imagination. (Albert Einstein)

Be who you are and say what you feel, because those who mind don't matter and those who matter don't mind. (Dr. Seuss)
0
paulonline2501
7/31/2006 4:23:48 PM

Thanks... ! :) 

0
sunny_popali
3/5/2008 12:30:56 PM
Reply:

Similar Artilces:

How can i correct the error saying "The data text and nvarchar are incompatible in the equal to operator"?
Using a new SqlDataSource and a GridView I have added a new parameter via the 'Where' option in order to retrieve only the record where the users' name is equal to the records 'AuthorName'; match the content of a TextBox labelled as Username to the database field titled 'AuthorName' (this has text as its data type). however, every time i run the page i get a server error saying "The data text and nvarchar are incompatible in the equal to operator".   I don't know why this is occuring as my TextBox and the filed in the database h...

sql data type "text" is what in .net?
What is the equivalent data type in .net for the sql data type "text"? I can pull varchars from the db as strings, but not this field with the type text. I get the error System.IndexOutOfRangeException: Description But if I change the type in the db, everything works. But, this field needs to be longer than a varchar. The line the error is on: _Description = Convert.ToString(dr(DESCRIPTION_FIELDNAME)) I tried using other types or not converting, no luck. This article has this to say about getting blobs: "The main difference is that in ADO.NET, you ne...

The data types text and nvarchar are incompatible in the equal to operator
Using the FormView control to attach to a SQL2005 database which has 'text' as a type verses 'nvarchar' and I received the error below. I switched the database type to a varchar and the edit function fo the FormView worked fine. I then switched the database type back to 'text' and the error re-occurred. Any ideas?   Server Error in '/WebSite2' Application. The data types text and nvarchar are incompatible in the equal to operator. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information...

Error: The data types text and text are incompatible in the equal to operator.
I get this error: The data types text and text are incompatible in the equal to operator. when trying to execute this query SELECT id FROM users WHERE username=@userName     Any Ideas?http://www.misii.uni.cc/ We'll need to know te data type of the username column, as well as the SqlDbType you are using for the @userName parameter.Terri MortonEngagement Manager, NeudesicHow to ask a question I'm using text and text.http://www.misii.uni.cc/ Can't do that.  There are a number of things that you can't do with blob data types, and that's one of them.  Considering t...

SQL Server Error: "Arithmetic overflow error converting numeric to data type numeric"
I'm still quite new to SQL, and so I may be missing something quite obvious. Apologies in advance if that's the case. I've included my query at the bottom of the message as it is quite long; my problem is that I get "Arithmetic overflow error converting numeric to data type numeric" when the first parameter to my COALESCE calls is not NULL. That is, the COALESCEs and the query work as I expect when SUM(cust_vw_actual.Actual) is NULL (they return 0.00), but if it isn't I get the error. I am also getting "Warning: Null value eliminated from aggregate.&...

would like to create script which check if login.Text (from textbox "login") equals "szmitek" and passwod.Text equals "password"
I would like to create script which check if login.Text (from textbox "login") equals "szmitek" and passwod.Text equals "password". I have done it in this way: protected static void Main(string[] args) { string clogin = "szmitek"; string cpassword = "password"; } protected void SubmitBtn_Click(object sender, EventArgs e) { if (HttpUtility.HtmlEncode(login.Text) = (clogin)) if (HttpUtility.HtmlEncode(password.Text) = (cpassword)) { Response.Redirect("admin.aspx"); } else { Response.Redirect("fail.aspx"); } else { Response.Redirect("fail.aspx"); } } But it i...

Whan can i do? make "string" data type convert to "window" data type, and use a "window" name to get it ancestor "window name", thanks! i use pb5
Rich, With a string window name, you can open a window of that type if you need to. You could, of course, query that window object for any attributes. Another option is to use the LibraryExport function to export the definition of the window which is specified by the string. You can then parse the resulting file to get information on the ancestor object. HTH Sanjiv. "Rich" <windows_ce@netease.com> wrote in message news:2Xsr1WW0AHA.178@forums.sybase.com... > > > ...

"Error converting data type nvarchar to numeric."
Hi  Im using the <asp:SqlDataSource to display a table in a datagrid. The data grid has AutoGenerateEditButton="True". I’m using this update command in the QslDataSource: UpdateCommand="UPDATE ShoeSize SET US = @US, Eur = @Eur, CM = @CM, Quant = @Quant, id = @id, UK = @UK  FROM ShoeSize WHERE IDroll = @IDroll" All the cells in the table is decimal(6,1) except ID, quant and IDroll witch are ints. But when I press update I get this error message: "Error converting data type nvarchar to numeric." I unde...

Getting Server Error "Syntax error converting the nvarchar value 'Sonoma' to a column of data type int."
Hi, all I'm getting this error at runtime when my page tries to populate a datagrid. Here's the relevant code. First, the user selects his choice from a dropdownlist, populated with a sqldatasource control on the aspx side:<asp:SqlDataSource ID="sqlDataSourceCompany" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="SELECT [PayrollCompanyID], [DisplayName] FROM [rsrc_PayrollCompany] ORDER BY [DisplayName]"> </asp:SqlDataSource>  And the dropdown list's code:<asp:DropDownList ID="ddlPayrol...

Display Text "Yes" or "No" instead of a Checkbox for an Access DB yes/no data type
I am using a DetailsView control to display data from a row in an Access DB. This works fine but instead of displaying a checkbox that is blank or has a check in it,  I would like to display the text of, either "Yes" or "No" on my web page. How can I do this?   Hi Convert the column to TemplateField and remove the checkbox in ItemTemplate then add a label and bind it to your column:                     <ItemTemplate>          ...

The data types text and nvarchar are incompatible in the equal to operator.
The following is the full error message.  I am posting the code after. Server Error in '/XprtDr' Application. The data types text and nvarchar are incompatible in the equal to operator. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: The data types text and nvarchar are incompatible in the equal to operator.Source Error: An unhandled exception was generated during t...

Error:"The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value."
I still don't know what is happening with my application. I used before in another page the formview control and I didn't have the out of range Date error. It was normally. But now, I'm doing everything manually and I don't know why, but I'm with this problem. I need to safe this problem today... Here go my code! The error occurs here: (It's the Sub that Insert data inside of the database(SQLServer)Protected Sub Gravar_Click(ByVal sender As Object, ByVal e As System.EventArgs) Dim SQL As String = "Update RECEBER SET  EMISSAO = '" & CType(tbDataEmissao.Text, Date) & "', VENCIME...

"data only" "log only" data and log"
i altered the db to include 1 gb. however the fragment was created "data and log". what should have i done to create a 'data only' fragment? melanie wrote: > i altered the db to include 1 gb. > however the fragment was created "data and log". > > what should have i done to create a 'data only' fragment? I believe I'm correct in saying that if your database has data and log on separate devices the alter database command will assume you're adding to "data" unless you specify otherwise by using the "log on&q...

Gridveiw Error (The data types image and nvarchar are incompatible in the equal to operator. )
hi, i have a table with image field. In the Gridview i have a delete button, when i click the delete button, i get this error, any help please The data types image and nvarchar are incompatible in the equal to operator. ...

Web resources about - Error, "The data types text and nvarchar are incompatible in the equal to operator" - asp.net.sql-datasource

Resources last updated: 1/20/2016 3:42:07 PM