.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Post New Web Links

Operand type clash: xml is incompatible with text

Posted By:      Posted Date: August 30, 2010    Points: 0   Category :ASP.Net
hi to all .thank in advance ..i am using sql server .i want insert below xml into one column in table which is xml data type but i am getting error Operand type clash: xml is incompatible with text .pls tell me solution for this ?<Message xmlns="http://www.abcscripts.com/messaging"><Header><To>mailto:6033168728001.spi@abcscripts.com</To><From>mailto:9900007.ncpdp@abcscripts.com</From><MessageID>541481b182404a3ea819f0aba886e652</MessageID><RelatesToMessageID/><SentTime>2010-08-23T18:27:28.2Z</SentTime></Header><Body><RefillRequest><RxReferenceNumber>163U067PL4E5LYK0D1EGXTA57JUW5HCFQ4B</RxReferenceNumber><Pharmacy><Identification><NCPDPID>9900007</NCPDPID><FileID>TW1FKB1P1H2P468L3L7RM812GR7X5O70VQ3</FileID><StateLicenseNumber>5602NPPQGU765FX7262US8X6G18NMG67H47</StateLicenseNumber></Identification><StoreName>Druglix</StoreName><Pharmacist><LastName>Pharmacist last name goes here noww</LastName><FirstName>Pharmacist First name goes in here</FirstName><MiddleName>Pharmacist Middle name goes here</MiddleName><Suffix>Junior iii</Suffix><Prefix>Pharmacist</Prefix></Pharmacist><PharmacistAgent><LastName>Pharmacist agent Last name go

View Complete Post

More Related Resource Links

perand type clash: nvarchar(max) is incompatible with image

in sql2005 how to add a hex string to an image field.here imageHx is image field and @ImgHex is nvarchar(max) field.i am getting error likeperand type clash: nvarchar(max) is incompatible with imageupdate #TmpCamRep set ImageHX=(@ImgHex)

When create a suvery using type Rating Scale, is it possible to create 5 range text?


When create a suvery using type Rating Scale, is it possible to create 5 range text?

Default range text only show 3 fields

... found operand of type 'xs:NMTOKEN *'

Using a XML Schema Collection . . . can't find anything on this type of error. Error: Msg 2389, Level 16, State 1, Line 64 XQuery [XML_TABLE.XML.value()]: 'value()' requires a singleton (or empty sequence), found operand of type 'xs:NMTOKEN *' Query: ;WITH XMLNAMESPACES ( 'http://abc' AS [abc], 'http://xyz' AS [xyz] ) SELECT [XML].value('/abc:ABC/xyz:XYZ/@id','NVARCHAR(MAX)') AS [id] FROM [XML_TABLE]  

Text was truncated with "nvarchar(max)" data type and size by using SSIS Import and Export Wizar



I am using SSIS Import and export Wizar to load data from Excel file, I have set the datatype as "nvarchar(max); those data are not biger than 1000 bits but was failed to transfer as the error says:

[Source - TreatmentPlans$ [1]] Error: The "output column "SchoolPlan" (57)" failed because truncation occurred, and the truncation row disposition on "output column "SchoolPlan" (57)" specifies failure on truncation. A truncation error occurred on the specified object of the specified component.

WCF returning "The content type text/html of the response message does not match the content type of

I have a WCF service I am trying to run on a new installation of 64-bit Windows Server 2008 IIS. Although it runs fine on Windows 2003 IIS, it is throwing the error in the thread title, which appears to be a server config issue, but I am not sure. Googling and searching the MSDN forums did not turn up a solution. I tried running WCF Logging, but that didn't help either.

Does anyone have any suggestions on how to solve this probelm?

Here is the error:

The content type text/html of the response message does not match the content type of the binding (application/soap+xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 1024 bytes of the response were: '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="Content-Type" content=&qu

Check if Type is numeric, text or date



How can i check if a type (of class Type) is numeric, text or date? Is there a simple method for this already?
Currently I'm checking it like this:

if(type == typeof(Int16) || type == typeof(UInt16) || type == typeof(Int32) ... and so on) return "numeric";

Converting a portion (numbers) of a text file name into a date type


I am working with a number of Flat Files that will be processed daily. The FileName is a combination of text and numbers. The numbers are the date of transaction. Therefore, I need to pick up the numbers and use it as a Date (DateAdded) inserted into the database. However, the positioning of the numbers is not fixed.  

Examples of what the File Names:   Dial20100610.txt and Dialog20100611.txt

Now, I have inserted all the data into a staging table called Raw_Staging with File Name as the name of the column (eg. Dial20100610.txt, Dialog20100612.txt)

Is there a way to strip the text character from the columns with tsql so I am only left with the numbers and then convert it to a Datetime datatype so I can insert it into the destination table?

Report Builder Filter shows Field as Date Type =Text instead of Date


My Data was created by retrieving ODBC data - using PowerPivot for Excel 2010, and has Birthdate defined as a Data Type = "Date".  This was uploaded to SharePoint, and a New Dataset was created to point at it.

I'm using Microsoft SQL Server 2008 R2 Report Builder 3.0.  I tried to filter this data on Birthdate, but when I go into the Filter, and specify the field that was defined as DataType = "Date" in PowerPivot - Report Builder changes the type to "Text", and gray's out the field so that I can't change it to "Date".

If I create an Expression as Cdate(Birthdate.Value), it lets me change the Data Type to "Date", and works appropriately, but we don't want to have to do this with every date field.

Why doesn't Report Builder see this field as a Date ? 

Format a TEXT data type


I have a report that pulls data from a TEXT data type column.  When users type data into the database, hitting the ENTER key will start a new line.   When I pull the text onto a report it pulls all the text as one long string. The spaces are there but the ENTER gets ignored.  This makes the information hard to read.   Is there any way to read up the ENTER character and have the report format the text accordingly?  Or some other way to accomplish the same goal?


ContentResult type="text/xml" - IE cannot display this feed


When I return a ContentResult that is ContentType="text/xml" I get an error in the browser - Internet Explorer cannot display this feed.

What would be in the XML that is triggering IE to think it is a feed, and how do I tell IE to not think such things?

When I set Content to contain only the first, 2nd and last line of the XML stream, it renders correctly as XML.


Here is my code:

    public ContentResult InventoryFeed()
        ContentResult cr = new ContentResult();
        cr.Content = System.IO.File.ReadAllText("c:\\downloads\\amazon\\response.txt");
        cr.ContentType = "text/xml";
        return cr;


And here is the XML: 

<?xml version="1.0"?>

<GetFeedSubmissionListResponse xmlns="http://mws.amazonaws.com/doc/2009-01-01/">

Specifying a parameter in a matrix filter - the data type automatically changes to 'text' when it



When specifying a parameter in a matrix filter (Report Builder 2) the data type automatically reverts to 'text' when it should be 'date/time'.  Removing the parameter and re-adding it displays it correctly as 'date/time' but this isn't saved when clicking 'OK'. 

The problem only becomes apparent when the parameter is set to 'allow multiple values'.  Once this is selected the report throws up the following error:

"An error has occured during report processing. The processing of FilterExpression for the tablix 'Tablix1' cannot be performed.  Cannot compare data types System.String and System.Object[]. Please check the data type returned by the FilterExpression."

Is this a bug with Report Builder 2 or is there something wrong with my report model?

Any help/guidance greatly appreciated.

change the column type from single line of text to choice



I have created a calendar & there is an inbuilt column location that is single line of text, I want to change from single line of text to choice, but i don't see the option & I am not able to delete the Location column. is there any way to delete the column or change the type from single line of text to choice.


Thanks in advance  

Client found response content type of '', but expected 'text/xml'.


I migrated our SSRS database from Windows 2003 32 bit, SQL  Server 2005 to Windows 2003 64 bit and SQL Server 2008 R2.

The report manager loads and SSRS reports run ok.

In one of our website, it connects to the SSRS web service and list a list of reports under specified folder in a listbox control.

It was working in our original Windows 2003 32bit server with the same settings, but we are getting error when calling listchildren method:

[InvalidOperationException: Client found response content type of '', but expected 'text/xml'.
The request failed with an empty response.]
   System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) +413317
   System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) +300
   WebPortal.ReportServer.ReportingService.ListChildren(String Item, Boolean Recursive) in C:\Projects\OSCAR\WebPortal\Web References\ReportServer\Reference.cs:832
   WebPortal.Components.UIBinder.BindReportList(ListBox listbox, String reportFolder, String url) in C:\Projects\OSCAR\WebPortal\Components\UIBinder.cs:761
   WebPortal.WebForm4.BindData() in C:\Projects

ProtocolException: Content Type text/plan but expecting text/xml



I created a WCF service from a wsdl and am calling this service from a java. However, when I call the service it throws and error and places the follow in the App Tracelog. How do I fix this?

System.ServiceModel.ProtocolException: Content Type text/plain was sent to a service expecting text/xml; charset=utf-8.

Binding information:

      <service behaviorConfiguration="WcfIdentityServiceLibrary.ConnectorServiceBehavior"
        <endpoint address="" binding="basicHttpBinding" bindingConfiguration="" contract="WcfIdentityServiceLibrary.ConnectorService" />
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />


        <behavior name="WcfIdentityServiceLibrary.ConnectorServiceBehavior">
          <serviceMetadata httpGetEnabled="False"/>

Client found response content type of 'text/html; charset=utf-8', but expected 'text/xml'.


when i access this webservice(c#) in window project it show this error

Client found response content type of 'text/html; charset=utf-8', but expected 'text/xml'. 

please reply soon....

Exception : The type initializer for 'System.Text.BaseCodePageEncoding' threw an exception



I'm getting a strange exception in the following situation:

Dotnet application written in C#.

Pinvoking a dll written in C++ in which I'm calling CoInitialise();

After calling functions inside the dll, a call to System.console.WriteLine or a call to SQLConnection.Open() throws the following exception.

If I start the program with System.console.WriteLine("Starting Application) , then it solves the problem, as if it had initialized the environnement correctly before pinvoking the dll.


Do you have a explanation of this strange behavior?



   at System.Text.BaseCodePageEncoding.FindCodePage(Int32 codePage)
   at System.Text.BaseCodePageEncoding.LoadCodePageTables()
   at System.Text.BaseCodePageEncoding..ctor(Int32 codepage, Int32 dataCodePage)
   at System.Text.Encoding.GetEncoding(Int32 codepage)
   at System.Data.SqlClient.TdsParser.ProcessEnvChange(Int32 tokenLength, TdsParserStateObject stateObj)
   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
   at System.Data.SqlClient.SqlInternal

Set dynamic default value for a Single line of text column type


Hi all,

I have a Project name site column(type is Single line of Text) and need to populate it with site name. Since Site name is not known until site is created, how can I deal with this through XML.No coding should be used.And this column is also being used in Roll up process for the site.The Project Name value that is being populated in the text box should be a default value too.


ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend