Implicit conversion from data type ntext to varchar is not allowed. Use the CONVERT function to run this query.


Hello Guys,

Have been getting this error(

Implicit conversion from data type ntext to varchar is not allowed. Use the CONVERT function to run this query.

) when running on the live environment but it was fine when run locally. If anyone has similar problem please let me know the fix you have done.

Thank you.


~ Remember To Mark The Posts Which Helped You As The ANSWER ~
0
Crewe2008
10/9/2007 12:02:00 PM
asp.net.sql-datasource 29906 articles. 0 followers. Follow

2 Replies
1149 Views

Similar Articles

[PageSpeed] 51

 Seems like your database schema differs between live environment and local. Check the definition of the table, and also what type of parameter you use in your code.


If this post was useful to you, please mark it as answer. Thank you!
0
johram
10/9/2007 1:25:56 PM

 Below is a sample of creating and resolving your problem.

 

create table test
(
name varchar(50) ,
address ntext
)

--- case 1
insert test ( name , address ) values ( 'dhimant' , 'test ntext address' )


--- case 2 [produces an error]
insert test ( name , address )
select address , name
from
test

--- case 3
insert test ( name , address )
select cast ( address as varchar(100) ) , name
from
test

select * from test

  The case 2 in the above test will produce and error.  The point is that SQL server doesn't implicitly convert ntext data to varchar.  You'll have to explicitly convert it using the Cast function.  This was just to produce and solve your problem, I've knowingly tries to insert the value of address into name Wink.

Just have a look at the conversion chart provided below the CAST function help in BOL. 

Hope this will help. 


Thanks,
Dhimant Trivedi
"When the going gets tough, tough gets going."

"Mark as Answer" the post(s) which helped you solve the problem
0
dhimant
10/9/2007 1:39:04 PM
Reply:

Similar Artilces:

Implicit conversion from data type datetime to int is not allowed. Use the CONVERT function to run this query.
Hey im trying to store a category name and the date into a database. For some reason i keep getting this error  Implicit conversion from data type datetime to int is not allowed. Use the CONVERT function to run this query. This error is the error im getting back from the database. the datetime field in the database is a datatype (DateTime) so what exactly is going on ?protected void InsertNewCat_Click(object sender, EventArgs e) {                    string insertSql = "INSERT into...

Implicit conversion from data type sql_variant to varbinary(max) is not allowed. Use the CONVERT function to run this query
I get the above error on line 11 below when i do a fileupload and try to save it to database.any ideas how to get rid of it? 1 2 Partial Class Admin_Default3 Inherits System.Web.UI.Page4 5 6 7 Protected Sub dvPropertyAdmin_ItemInserting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DetailsViewInsertEventArgs) Handles dvPropertyAdmin.ItemInserting8 Dim upFile As System.Web.UI.WebControls.FileUpload = DirectCast(dvPropertyAdmin.FindControl("upFile"), System.Web.UI.WebControls.FileUpload)9 If (upFile Is...

when trying to do an insert, I get Implicit conversion from data type sql_variant to uniqueidentifier is not allowed. Use the CONVERT function to run this query
 Im getting this error below when I try to do an insert into my database. I have no idea why this is happening, please help!this is my sqldatasource:<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:myConnectionString %>"            DeleteCommand="DELETE FROM [tblDiaryEntries] WHERE [DiaryEntryID] = @DiaryEntryID"            InsertCommand="INSERT INTO [tblDiaryEntries] ([DiaryEntry]...

Help : Disallowed implicit conversion from data type ntext to data type varchar,.
Hi all,        i have feedback table with column comments1(varchar) & comments(ntext) ..i tried to copy the content from column Comments to another comments1 column,It shows the follwing error..My Query is ,                 "   update feedback set comments1=comments    "Error :Disallowed implicit conversion from data type ntext to data type varchar, table 'Test.dbo.feedback', column 'comments1'. Use the CONVERT function to run this query. ...

Converting a gridView using an Sql Datasource to a gridview who is not using an SQL DataSource
How can i rewrite this page so that i doesnt make use of an SqlDataSource?  <%@ Control Language="C#" AutoEventWireup="true" CodeFile="LoginHistory.ascx.cs" Inherits="Private_UserControls_WebUserControl" %> <html> <head> <%--<link rel="stylesheet" href="BaldwinPortal.css" mce_href="BaldwinPortal.css" type="text/css" />--%> <title>Login History</title> </head> <body style="margin:0 0 0 0;padding:0 0 0 0"> ...

conversion failed when converting the varchar value to data type int when using executenonquery()
I am trying to read a single value  from the database into a string using the executenonquery() Method and an stored proc but get the error conversion failed when converting the varchar value to data type int any ideas ?below is the code protected void Button2_Click(object sender, EventArgs e){ string CStr = ConfigurationManager.ConnectionStrings["app"].ConnectionString.ToString();SqlConnection Conn1 = new SqlConnection(CStr ); SqlCommand cmd1 = new SqlCommand("Usp_SysGetCreditCard", Conn);cmd1.CommandType = CommandType.StoredProcedure; cmd1....

error in SQL Store Proc ''Conversion failed when converting the varchar value to data type int'
Hi , I am having problem and error of 'Conversion failed when converting the varchar value to data type int ' CREATE PROC dbo.testingloop (DECLARE @testid varchar(max))ASBEGINSET NOCOUNT ONDECLARE @SQL varchar(600)SET @testvalue = CURSOR FORSELECT [test ID])  FROM Data42 where [test ID] = 36OPEN @testvalue      FETCH NEXT     FROM @testvalue INTO @testid      WHILE @@FETCH_STATUS = 0       BEGIN      ' My update statement here  ...

How to convert varchar data type into datetime data type without data lose
Hi all, i have stored date as varchar(30) data type and Date format is dd/MM/yyyy now i have to convert it into datatime data type can u help me in query ?  i have 330 records and each recod contain the Date in format of dd/MM/YYYY but due to varchar data type i can not perform calculation on Date so i have to convert into datetime without data lose. please help me in this regard. Best RegardsRameezWaheed  life is name of learning!Mark as an answer if it helps You can check these posts http://forums.microsoft.com/TechNet/ShowPost.aspx?PostID=2039108&SiteID=17   ...

Why Visual Studio 2005 ask me to convert a solution already got converted Somebody did the conversion of a solution from .net 1.1 to .net 2.0 by using the automatic conversion wizard of Visual Stu
Why Visual Studio 2005 ask me to convert a solution already got converted Somebody did the conversion of a solution from .net 1.1 to .net 2.0 by using the automatic conversion wizard of Visual Studio 2005. Then, he changed to another company. Now, I take over his job. Unfortunately, when I attempted to open that solution, Visual Studio 2005 prompted me the conversion wizard again to forced me to perform a conversion on the solution. Does someone know why?--Harish Patel www.MicrosoftSQLandASP.netpatelharish@gmail.com Hi, How many projects are in the solution, does it have UNLOADE...

I cnahged a coloumn from int to varchar and now Subsonic says: Conversion failed when converting the varchar value 'anytext' to data type int.
I had created a table with column "ColoumnName" as int. I run SubCommander\sonic.exe to generate all classes (in Generated dir) and worked/coded for a while (weeks) without any probs. Then I had to change that coloumn from int to varchar. I run sonic.exe again but this instruction:        ds = DataService.GetDataSet(q); (where ds is a DataSet and q is a QueryCommand) gives the error: Conversion failed when converting the varchar value 'anytext' to data type int. Please note that the above instruction didn't change recently and worked...

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... > > > ...

The conversion of a varchar data type to a datetime data type resulted in an out-of-range value.
Hi Guys, I've tried reseasrching this problem on the internet without success. I'm UK based and Classic ASP trained but having problems with asp.net (VB) Inserting "Date" Data into an inherited MS-SQL Server 2008 table's date field. 1.) In webconfig's System.Web section I have added the following: <globalization culture="en-GB" uiCulture="en-GB" /> ' so I'm now hoping all dates can be handled as dd/MM/yyyy! 2.) In SQL Server the "Default Value or Binding" for the quote_date field is set to '...

Implicit conversion from data type datetime to int is not allowed.
Here is the situation... I am using SQL Server 2000.  I have created a Store Procedure to insert information, 4 of the fields are date types.  I am using OleDb Data Provider (System.Data.OleDb) namespace. The dates are filled by a form (web form) on submit event, I created a class that has functions to create my OleDb Parameters.  I add the parameters to the command and execute it through a SQL Server Stored Procedure.  In the event that I must have coded something wrong, I tested in the SQL Query Analyzer and the IN parameters for the date I used the getDat...

convert to db2 data types using vb.net
I am using odbc.net to connect to db2 DSN. And I made a connection and I can use the select command to retrive data from db2. But when I tried to update the db2, it doesn't work. I guest I need to convert datatype. I don't know how to do it. As you can see from the following code. I can retrieve passNum fro MIGESTN. But when I tried to update the number in db2, it failed. Thanks Dim cn As OdbcConnection cn = New OdbcConnection("dsn=HRINFO;") Dim mystring As String = "select * from MIGESTN where MINEXT > 1000000" ...

Web resources about - Implicit conversion from data type ntext to varchar is not allowed. Use the CONVERT function to run this query. - asp.net.sql-datasource

Gene conversion - Wikipedia, the free encyclopedia
Gene conversion is the process by which one DNA sequence replaces a homologous sequence such that the sequences become identical after the conversion ...

Family of Enrique Marquez unaware of his 2014 marriage, conversion to Islam
The family members of Enrique Marquez, the man linked to the San Bernardino massacre, said they were unaware he was married or that he had converted ...

Effective Strategies for Increasing E-Commerce Conversions
... tips for improving your ecommerce strategy and related outcomes. Social signals are a powerful tool for engaging users and increasing conversion ...

Christmas Verse: A tale of conversion or, as Christians view it, re-birth
The Journey of the Magi, T. S. Eliot 'A cold coming we had of it, Just the worst time of the year For a journey, and such a long journey: The ...

Revisiting Carlos Martinez's rotation conversion
... thanks to his pitch mix, then it sure sounded like it could be possible. Now, almost a full year later, I wanted to revisit Martinez's conversion. ...

Dow to Force Conversion of Buffett Preferreds If Rally Holds
Bloomberg Dow to Force Conversion of Buffett Preferreds If Rally Holds Bloomberg Dow Chemical Co., which has been paying $255 million annually ...

​Judge orders N.J. "gay conversion" nonprofit to close
Jews Offering New Alternatives for Healing, known as JONAH, ordered to cease operations within 30 days

Malaysian mother loses court battle over conversion of children to Islam
A kindergarten teacher in Malaysia is to appeal to a higher court after she lost a case challenging the conversion of all her three children ...

Council votes to ban gay 'conversion' therapy in Cincinnati
Cincinnati follows four states and the District of Columbia banning the therapy, becoming the first city outside D.C. to do so.

Solar Frontier Pushes CIS (aka CIGS) Thin Film Solar Envelope With New Conversion Record, Factory Model ...
Japan's Solar Frontier comes up with a killer combo, a new low cost thin film solar manufacturing model and a new solar conversion efficiency ...

Resources last updated: 1/12/2016 5:48:13 PM