convert type 'System.Xml.XmlDataDocument' to 'System.Data.DataSet'

I am using XMLDataDocument in web services which returns XMLDataDocument

using this XMLDataDocument for Dataset in application getting error 

Cannot implicitly convert type 'System.Xml.XmlDataDocument' to 'System.Data.DataSet' 

any idea 

2/15/2007 9:45:36 AM 7071 articles. 0 followers. Follow

3 Replies

Similar Articles

[PageSpeed] 18
Get it on Google Play
Get it on Apple App Store

XmlDataDocument has DataSet property to get the document as a data set.


Teemu Keiski
Finland, EU
2/15/2007 10:27:49 AM

    public XMLDataDocument xmldoc(DateTime x, DateTime y)
        df = dateFrom;
        dt = dateTo;
        XmlDataDocument xmldoc = new XmlDataDocument(dataSet);

return xmldoc;


now how can i show this XMLDataDocument as gridview in application be

 DataSet resultDataSet = service.xmldoc(dateFrom, dateTo); give error convert type 'System.Xml.XmlDataDocument' to 'System.Data.DataSet'


2/15/2007 10:55:19 AM


As I tried to say, you get the DataSet from XmldataDocument's DataSet property.

//First get what the ws returns
XmlDataDocument doc = service.xmldoc(dateFrom, dateTo);

//Get the DataSet from the XmlDataDocument
DataSet resultDataSet = doc.DataSet;


Teemu Keiski
Finland, EU
2/15/2007 11:04:21 AM

Similar Artilces:

convert type 'System.Data.DataSet' to 'System.Data.DataTable'
 I got this error  : Cannot implicitly convert type 'System.Data.DataSet' to 'System.Data.DataTable' i have written code like thisDataTable dt = new DataTable(); dt = GetGalleryImages(name); Possibly coz GetGalleryImages returns a dataset and not a datatable? Try: DataSet ds = GetGalleryImages(name); what type does GetGalleryImages return?  If this returns a dataset then you will have to change datatable to dataset, then index the table of the dataset.Please mark as answer if you find helpful.Ustes G....

Cannot implicitly convert type 'System.Data.DataTable' to 'System.Data.Dataset'
I am using an excel spreadsheet as a data source to build a dataset which is then used to populate a grid:  I am getting the following error: Cannot implicitly convert type 'System.Data.DataTable' to 'System.Data.Dataset' Here's my code:private DataSet GetData(String description, String mpnumber, String link) { //MPData will represents the Data in Application Cache. We will use Cache Data //for performance purposes, because MP Information will not change often. I choose // to also use Dataset Filtering instead of SQL Server Filtering. However the DataAccess l...

Cannot implicitly convert type 'System.Xml.XmlNode' to 'XmlNode' and 'XmlNode' does not contain a definition for 'AppendChild'
Hi,      XmlNode t = xmlDoc.SelectSingleNode("/NewDataSet/Table1/Template");//Cannot implicitly convert type 'System.Xml.XmlNode' to 'XmlNode'//        XmlText textNode1 = xmlDoc.CreateTextNode("hello");                       XmlElement ChildofTemplate = xmlDoc.CreateElement("ChildTemplate");//'XmlNode' does not contain a definition for 'AppendChild'// ...

Error: foreach statement cannot operate on variables of type 'System.Data.DataSet' because 'System.Data.DataSet' does not contain a definition for 'GetEnumerator', or it is inaccessible
I am getting error on this line DataSet dsdata=new DataSet(); SQL="Seelct * from tablename"; //dsdata contains result of the above query foreach(DataRow dr in dsdata) //This line gives error Error: foreach statement cannot operate on variables of type 'System.Data.DataSet' because 'System.Data.DataSet' does not contain a definition for 'GetEnumerator', or it is inaccessible DataSet dsdata=new DataSet(); SQL="Select * from tablename"; //dsdata contains result of the above query foreach(DataRow dr in dsdata.Tables[0].Rows) //This ...

Value of type 'System.Web.UI.Control' cannot be converted to 'System.Web.SiteMap'.
 Hello,         I receive this error "System.Web.UI.Control' cannot be converted to 'System.Web.SiteMap" when I try to find the Sitemap control.  ...            <asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" />            <asp:ListView ID="ListView1" runat="server">            <LayoutTemplate>    ...

Value of type 'System.Data.Dataset' cannot be converted to 'String'
I receive the above error for line 57 which is: Address.text = Clientinfo(DropDownlist1.Items(DropDownList1.SelectedIndex).text) I'm trying to take the selected item from the dropdownlist1 and have the data from the query 'Clientinfo' appear using the label control called 'address'. I plan to format it to be used as a mailing address: 123 Street City, State Zip Etc. Obviously I am learning as I go. Can anyone give me an alternative or find my error. Much appreciated. The code is below: Sub Page_Load(Sender As Object, E As EventArgs) If Not Page.IsPostBa...

Cannot convert type 'myWebService.GetMyMethode' to 'System.Data.DataSet'
Hi all, I have a webservice that I call in my other application web. In my webservice, I have a method that return a DataSet. MyWebService new1 = new MyWebService();GridView1.DataSource = (DataSet)new1.GetMyMethod();GridView1.DataBind();  But I had this message : Cannot convert type 'myWebService.GetMyMethode' to 'System.Data.DataSet' I found the KB article number 815131 But this bug to apply  only to :   • Microsoft Visual C# .NET 2003 Standard Edition • Microsoft Visual C# .NET 2002 St...

'TypeConverter' is unable to convert 'System.Data.SqlClient.SqlConnection' to 'System.Data.SqlClient.SqlConnection'.
Hey, I was hoping someone could shed some light on this error for me. I am using the TypeConverter in the System.ComponentsModel Namespace, and when I attempt to take an object, which in this case is a SQLConnection, and perform a TypeConvert (code example below) I get the following error: Error: ---------------------------------------------------------------------------- 'TypeConverter' is unable to convert 'System.Data.SqlClient.SqlConnection' to 'System.Data.SqlClient.SqlConnection'. ---------------------------------------------------------------------------- ...

Value of type 'System.Net.Mail.MailMessage' cannot be converted to 'System.Net.Mail.AlternateView'
Trying to create an alternateview to send a txt email with the html formatted email.  I've used string builder to create the whole email, but I get this error.  Any ideas why?  i've bolded the line that throws the error... Dim EmailBodyTxt As New StringBuilder EmailBodyTxt.Append("<html><style type='text/css'>.table{border:solid; border-color:#006666; width:600;} ")EmailBodyTxt.Append("<body><table class='table'><tr><td colspan='2'><h1>Test<br />RESPONSE SYSTEM</h1></td>...

The type name 'XmlDocument' does not exist in the type 'System.Web.UI.WebControls.Xml'
Hi Guys,  I am trying to convert a desktop app i wrote in VB to a web app written using C# .Net. The program checks XML entered against a XML schema and validates it. I have used the below code to validate the XML but am receiving the error in the title of this thread: {Xml.XmlDocument xmlDoc = new Xml.XmlDocument();  try{  xmlDoc.LoadXml(TextBox1.Text);}  catch (Exception ex){  TextBox2.Text = (ex.Message);  return;}} Why would this error be occuring? I have the below at the top of my aspx.cs page: using System;using System.Drawing;using System.Data;usin...

Error: Cannot convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.ButtonField'
Hello, I am getting the following error during compiliation. Any suggestions to fix it. Thanks. Cannot convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.ButtonField' protected void gvEvents_RowCommand(Object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Select") { int index = Convert.ToInt32(e.CommandArgument); GridViewRow selectedRow = gvEvents.Rows[index]; string sID; ButtonField btn; if (selectedRow.RowType == DataControlRowType.DataRow) { sID = ((ButtonField)selectedRow.FindControl("ID")).DataTextFi...

Error: Value of type 'System.Data.CommandBehavior' cannot be converted to 'System.IAsyncResult'.
  I wrote this code to retrieve data from the database using autocomplete extender control. Dim Dr As SqlDataReaderDim RtData As List(Of String) = New List(Of String) Dr = MysqlCmd.EndExecuteReader(Data.CommandBehavior.CloseConnection) While Dr.Read()RtData.Add(Dr("CustName").ToString()) End While   Plz Help!   regards   yamani     The EndExecuteReader does not take a CommandBehavior.  The BeginExecuteReader does.  Please follow the example on the MSDN documentation:

Object of type 'System.Boolean' cannot be converted to type 'System.Int16'.
I have a Checkbox on a detailsview bound to a small int field in my database table.It binds fine when showing the item template on the detailsview, but when I try do an insert/update it blows up with that error.Surely I can bind a checkbox to an integer field, so that unchecked translates to 0, and checked translates to 1?The reason I use a smallint, is its future-proof.  If we decided to switch to a status instead off/on in the future, there are less changes required.  As long as 0 is False and any other value is considered True you should be able to bind the value like this: C...

Object of type 'System.DBNull' cannot be converted to type 'System.DateTime'.
Hi, How can I pass null values to a system.datetime? Thanks in advance for the help J   Below is my code:   Public Class Courses     Public Sub Update_Class(ByVal ClassId As Integer, _    ByVal StatusId As Integer, _    ByVal ClassNumber As Integer, _    ByVal TeacherId As Integer, _    ByVal AmountofParticipants As Integer, _    ByVal CourseDate1 As DateTime, _    ByVal CourseDate2 As DateTime, _    ByVal CourseDate3 As DateTime)     Dim myConnection As New SqlConnection(Conn...

Web resources about - convert type 'System.Xml.XmlDataDocument' to 'System.Data.DataSet' -

Resources last updated: 11/26/2015 12:23:16 AM