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

Top 5 Contributors of the Month
Post New Web Links

XCData converted to XText when using WCF

Posted By:      Posted Date: September 02, 2010    Points: 0   Category :WCF
I am sending a XElement with WCF from a server to a client. In the Server my XElement contains a child of the type XCData. On the client side I receive a XElement that contains a child of the type XText. The value of the XText is still the same as the value I had in the XCData element but the type changed from XCData to XText. So somehow the XCData gets converted to a XText when I send the data to the client using WCF. Did anyone experience the same problem? What can I do that I receive a XCData object as I had on the server side and not a XText.

View Complete Post

More Related Resource Links

Got a problem with CGI - can it be converted to asp.net?


Ok, what I want to do is take input from a simple web post that used to be in CGI format and post it into my database. I am figuring using .net would be cleaner and easier to maintain. However, I have no clue how to convert this to .net. I could use some help please...thanks :)  The script below doesn't error out but it also doesn't insert either... The script reads like this:

use strict; 
use warnings; 
use CGI qw(:standard); 
use CGI::Carp qw(fatalsToBrowser warningsToBrowser); 
use DBI qw(:sql_types); 
my $title = 'Reading List'; 
my $start = 40; 
print header(), start_html($title),
h1({-style=>"font-size:1.2em"}, $title);
my $value = param("value");
print "'value' param = $value"; 
my $dbName = "DATABASE"; 
my $dbHost = ""; 
my $dbUser = "user"; 
my $dbPass = "pass"; 
my $dbh = DBI->connect("DBI:mysql:$dbName:$dbHost", $dbUser, $dbPass, { RaiseError => 1 }) or die "Die: $DBI::errstr\n";
my @fields = param();
my @values = param(my $variable);
my @filehandles = upload(my $variab

Sorting a ListBox or ComboBox on a Converted Value

Is it possible to apply a Converter to the SortDescription of a CollectionViewSource?  My ViewModel contains a List<> of a class that contains an enum and a Boolean.  My XAML displays a multi-select ListBox, showing the localized names of the enum values using a Converter in the View, and binds each ListBoxItem's IsSelected to the Boolean in the members of the bound List<>.  That's working.  Now I want to sort the ListBox items by those localized enum names, without reordering the List<> in the ViewModel.  Is this possible, and if so, how can it be done?

Converted reports don't work anymore in VS2010

Hi, I have an web application which in converted from vs2008 to vs2010. This app. has one simple reports, which is also converted. Now I have a few problems.The converted report doesn't render anymore. Somehow the dataset I used is not visible to the report anymore. So I decided to delete this datasource and create a new one, using the new interface in VS 2010. The annoying with this is that the new dataset, which is created when I follow the wizard, in the root of the application. As soon as I move this dataset to a folder (in my case the DataSet-folder), the reports doesn't see the fields anymore. So I copied the dataset back to the root, to solve this problem.However, when I render the report, i got an error message saying "A data source instance has not been supplied for the data source 'name-of-the-dataset'"I tried to search the inet, but I cannot find any possible solution.Does anyone of you know how to solve this issue? Or provide me with some links showing good examples.Sorry, but I was able to find the datasource problem myself. What I still would like to know if it is possible to change the location of the DataSet. I don't like the dataset to be in the root of my application.TIA

how do I pass in a standard xml+xsl to be converted through the Sharepoint 2010 Document Conversion

How do I pass in a standard xml+xsl to be converted through the Sharepoint 2010 Document Conversion? Via the SDK I have been able to code a c# workflow that converts word files in a Sharepoint 2010 Document Library (docx,dox, word.xml) to PDF successfully but want to pass in an xml+xsl file to this engine if possible. Actually I have xml, xsl, and if needed xsl-fo files to deal with but would be happy if I could figure out how to make the Document Conversion engine do the xml+xsl transform and then send that to a doc file in Sharepoint.    

Object of type Sys.UI._Time' cannot be converted to type Sys.UI._Timer

I have a main page with several menu choices, one of which launches an ajax enabled window.  The following pattern occurs: If I: 1) Launch site 2) Select menu choice listed on master page that is not ajax enabled 3) Select menu choice that launches ajax enabled popup. 4) close pages All is OK. If I repeat the steps, but in step 2 I select an ajax enabled page and them launch popup, I get the following error: Message: Sys.ArgumentTypeException: Object of type 'Sys.UI._Timer' cannot be converted to type 'Sys.UI._Timer'. I have spent days on this and have been unable to solve it.  If I remove the ajax ToolkitScriptManager and update panels from any of the pages and launch the popup, it works. Can anyone offer some guidance? that are not ajax enabled and then selethat includes an ajax enabled popup window.  T 

captcha VB code converted to C#

Hi I'm trying to implement captcha into my feedback form and my site is built in c#. I'm trying to add the Sub btnSubmit_Click(ByVal sender As Object, ByVal e As EventArgs) script section into the code behind but it's in VB, does anyone here no how to convert it to C#? The captcha.net site only has the VB variant in its installation tutorial so i'm stuck at this point.   many thanks   Rob.  <%@ Page Language="VB" %> <%@ Register TagPrefix="recaptcha" Namespace="Recaptcha" Assembly="Recaptcha" %>  <script runat=server%gt; Sub btnSubmit_Click(ByVal sender As Object, ByVal e As EventArgs) If Page.IsValid Then lblResult.Text = "You Got It!" lblResult.ForeColor = Drawing.Color.Green Else lblResult.Text = "Incorrect" lblResult.ForeColor = Drawing.Color.Red End If End Sub </script> <html> <body> <form runat="server"> <asp:Label Visible=false ID="lblResult" runat="server" /> <recaptcha:RecaptchaControl ID="recaptcha" runat="server" Theme="red" PublicKey="your_public_key"

Web Service Response Question: < and > getting converted to > and >


Hi there,

I created a asmx web service which returns a string as response. The return response is as follows:

<?xml version="1.0" encoding="utf-8" ?> 
 <string xmlns="https://xyz.com"> <result>Success</result></string> 
 But when the client is doing http post they are getting the following response on their side:
<?xml version="1.0" encoding="utf-8" ?> 
 <string xmlns="https://xyz.com"> &lt;result&gt;Success&lt;/result&gt;</string> 
What should i be doing so that the client sees < and > instead of &lt; and &gt; ?

>>Object of type 'System.Boolean' cannot be converted to type 'System.Byte[]'.



I am trying to upload a picture into database using FormView insertItemTemplate. 

FormView is bounded by objectdatasource.

To upload, I placed FileUpload control inside insertItemTemplate.

In table the dataType is image.


Object of type 'System.Boolean' cannot be converted to type 'System.Byte[]'.

Any swift reply would be appreciated. Thanks.


SharePoint add converted document as new version on original file



I am implementing a custom SharePoint Document Converter. What I want is the Document Converter Framework to add the converted document as a new version of the original document.

In other words: I want to convert "test.doc" into "test.pdf" and "test.pdf" must not be added as a new file (listitem), but as a new version of "test.doc".

How can I accomplish this?



Object of type 'System.Int32' cannot be converted to type 'System.String


When i'm trying to update a table using dynamic data, i'm getting the following error. I was trying to google the solution for the whole day, but it didnt work. I tried to declare the type of parameters like this

<asp:LinqDataSource ID="DetailsDataSource" runat="server" EnableUpdate="true"
                onupdating="DetailsDataSource_Updating" > <UpdateParameters><asp:Parameter Name="PK_ID" Type="Int32" /><asp:Parameter Name="id" Type="Int32" />
                <asp:Parameter Name="c_titulu" Type="Int32" />
                <asp:Parameter Name="perio" Type="Int32" />

Value of type 'Integer' cannot be converted to 'System.IntPtr'


I am receiving an error with a line of code I have learnt from a tutorials site (after converting it from C# to VB):

Dim thumb As System.Drawing.Image = image.GetThumbnailImage(CInt(Math.Truncate(imgWidth)), CInt(Math.Truncate(imgHeight)), Function() False, DirectCast(0, IntPtr))

The error relates to the "IntPtr" part, and reads:

"Value of type 'Integer' cannot be converted to 'System.IntPtr'"

Strangely, when this code was contained in a different class, there was no issue with it! I have imported the following:

Imports System.Collections
Imports System.Collections.Specialized
Imports System.Configuration
Imports System.Text
Imports System.Text.RegularExpressions
Imports System.Web
Imports System.Web.Caching
Imports System.Web.SessionState
Imports System.Web.Security
Imports System.Web.Profile
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.WebControls.WebParts
Imports System.Web.UI.HtmlControls

Any ideas?

reports 2008 R2 that converted from 2005 works slowly



I’ve converted my RS project from 2005 to 2008 R2 version. I’ using Report services with SharePoint 2010 integrated mode.


The report has some parameters and a stored procedure as a data source.  One of the parameters contains about 2000 values

In VS preview the report works quickly, but when I deploy report on SharePoint it works very slowly and Internet Explorer 8 uses

Using UrlDecode '+' present gets converted to blank


Hi ,

I am using System.Web.HttpUtility.UrlDecode() function to decode the url. In case if the encoded url has a '+' sign this gets converted to blank.

Does anyone know how to fix this ??


Service Reference: return type converted to a "ref" parameter



I created a WCF service using Message Contracts. One of the operations in the service takes in an entity (embedded in a message contract) and returns an updated version of the entity:

EWADemo.MessageContracts.CustomersService.SaveCustomersResponseMessage SaveCustomers(EWADemo.MessageContracts.CustomersService.SaveCustomersRequestMessage request);

[MessageContract(WrapperName = "SaveCustomers")]
public partial class SaveCustomersRequestMessage
 public EWADemo.DataContracts.Customers Customers

[MessageContract(WrapperName = "SaveCustomersResponse")]
public partial class SaveCustomersResponseMessage
 public EWADemo.DataContracts.Customers Customers

When I tried creating a s

Value of type 'System.Web.UI.Control' cannot be converted to 'ProductDetails'.


Hi all,

Can anyone help me for this?

get error in the header after this



        Private Sub UpdateToolTip(ByVal elementID As String, ByVal panel As UpdatePanel)
            Dim ctrl As Control = Page.LoadControl("/ProductDetails.ascx")
            Dim details As ProductDetails = DirectCast(ctrl, ProductDetails)
            details.ProductID = elementID
        End Sub



how to table converted in form using jquery


My table is

Acct    Books    Annual
Acct    Books    Monthly
Acct    Tax    Income Tax
Admin    GH    Eqpt
Admin    Offc    Eqpt
Admin    Offc    Misc
Admin    Offc    Eqpt
BPO    DE    DE.US
Corp    Comp    Insurance
Corp    Legal    Court
Corp    Legal    Court

but i require this output

  Income Tax
<ul>   GH 
<li>   Eqpt

<ul> Offc 

VB.Net Late binding operations cannot be converted to an expression tree.


Hi I get this error
"Late binding operations cannot be converted to an expression tree."

At all my x.NAME) lines !?

Im new to this so can anyone say me why i get this error..
Hvorfor gør den det !?


        <div>Navn: <%: Html.EditorFor(Function(x) x.Name)%></div>
        <div>Linje 1: <%: Html.EditorFor(Function(x) x.Line1)%></div>
        <div>Linje 2: <%: Html.EditorFor(Function(x) x.Line2)%></div>
        <div>Linje 3: <%: Html.EditorFor(Function(x) x.Line3)%></div>
        <div>Postnr: <%: Html.EditorFor(Function(x) x.Zip)%></div>
        <div>By: <%: Html.EditorFor(Function(x) x.City)%></div>
        <div>Landsdel: <%: Html.EditorFor(Function(x) x.Country)%></div>
            <%: Html.EditorFor(Function(x) x.GiftWrap)%>
            Disse vare skal i Gaveindpakning.

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