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


Top 5 Contributors of the Month
ASPEvil
Ashutosh Jha
Jean Paul
satyapriyanayak
SP
Post New Web Links

DataTable does not support schema inference from Xml.

Posted By:      Posted Date: September 28, 2010    Points: 0   Category :ASP.Net
 

I want to load the content of an xml file to a DataTable. I created a Class named News that contains the following function.

Public Shared Function listOfEmployees() As DataTable
        Dim dt As New DataTable
        Dim xmlPath As String = System.Web.HttpContext.Current.Request.MapPath("~/App_Data/News.xml")
        Dim xmlSchema As String = System.Web.HttpContext.Current.Request.MapPath("~/App_Data/schemas/News.xsd")

        dt = New DataTable()
        dt.ReadXmlSchema(xmlSchema)
        dt.ReadXml(xmlPath)

        Return dt
    End Function

And I get the following Error:

DataTable does not support schema inference from Xml.

I want to call the the function from an Object Data Source and connected to a GridView.

My XML file looks as follow:

<?xml version="1.0" encoding="utf-8" ?>
<news>
  <newsItem>
    <id>01</id>
    <visible>true</visible>
    &


View Complete Post


More Related Resource Links

ASP.NET, HTML, JavaScript Snippet Support (VS 2010 and .NET 4.0 Series)

  
This post covers another useful improvement in VS 2010 - HTML/ASP.NET/JavaScript snippet support. Snippets allow you to be more productive within source view by allowing you to create chunks of code and markup that you can quickly apply and use in your application with a minimum of character typing.

Visual Studio has supported the concept of "snippets" for VB and C# in previous releases - but not for HTML, ASP.NET markup and JavaScript. With VS 2010 we now support snippets for these content types as well.

Multiple database support with Entity Framework

  
One of the features introduced in Entity Framework is being database independent. Which mean each database provider can support Entity Framework by implementing its provider.

This feature allows you build applications independent from the underplaying database provider. In this post I'm going to show how to build an application that support multiple databases using same conceptual model made by Entity Framework.

TreeSelector : playing with generics and type inference

  
create a generic way to define a selection starting from a tree of objects, the most simpler way as possible.

Let's start with the beginning...
Here is a very simple little interface defining a node of the tree, basically, a value and the references to the child nodes.

.NET 3.5 Adds Named Pipes Support

  
you want a named pipe server, all you have to do is create some instances of NamedPipeServerStream to handle each client connection. I stole the following code straight from the MSDN documentation.

How to bind GridView and DropDownList controls using DataTable object

  
In .net framework 2.0, you can load a DataTable in memory by consuming a data source using a DataReader. In this version you will find the flexibility in accessing the DataReader means write access code once and use again and again using DataReader. To see the functionality of DataTable consider an example that is created using VS2005.

DataTable - Load from IDataReader - CreateDataReader - ReadXml WriteXml - Free ADO.NET Tutorials

  
The DataTable in ADO.NET 2.0 has been seriously beefed up and I absolutely love it. Not everything we consume deals with multiple resultsets and requires the ever popular DataSet. With the cool new features in the ADO.NET 2.0 DataTable, we can get many of the cool features in the DataSet without all the extra baggage and memory footprint particular to multiple resultsets.

Load DataTable from IDataReader

Basic Support

  

Can anyone help me please?

 

I have been producing a registration form using html and asp.  I have managed to get it to send an email having copied script from a previous website which someone developed for me.  I now get the response going to the old address and with then old text.  How can I change it all to the new site?

This has been very frustrating as I am sure someone is going to say all I have to do is ...

Cheers

 

Mike 


Jscript error: Object does not support property or method

  

 Hi, i have little knowledge on javascript but i need to use this code get from somewhere for a jquery to work.

I face this "Jscript runtime error: Object does not support property or method" whenever im trying to run this page.

In my experience, im get this error msg 9 out of 10 times i use javascript in my system.

Im using Microsoft Visual web developer 2008, i wonder if this is related to my problem, i not sure there is anything i need to add as reference or update anything.

But anyway, in short, i just couldn't use javascript code when using this development tool because of this sort of error.

Anyway, it happen that last time i tried use the same type of jquery code in another project and it seems to work well without an error.

But now when im try to use it again in this recent project i created, it come out with this error and i have no idea how to solve it even look through google and this forum.

It doesn't really seems like its the code problem itself although im not sure, because any javascript code just couldn't work.

So below is my code that i need to use.

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" ></script>
<script type="text/javascript" src=&quo

PHP support for VS 2010

  

While I do most of our development in .net, we do have some systems in php. I was just wondering if there is any php support for VS 2010. I found vs.php 2.7, but frankly, VS is expensive enough, I don't want to have to buy something else for php support. I use eclipse right now which works fine, I just kind of wanted to consolidate my editors and only have one. Does anyone have any ideas for me? Thanks,


deploying to msdeploy does not support a proxy server

  

I am trying to deploy through webmatrix but my system Proxy server configuration is not being used. I assume that webmatrix would detect the proxy server settings and use that for the msdeploy calls under the hood. Can anyone confirm this is a know issue? 


Datatable in session

  

I am creating a simple shopping cart using a datatable that is passed into a session object.  I have a small mini cart that displays the total number of items in the cart as well as the running total - this is displayed in a web control.  When the web control starts up I run a try/catch to see if the session object exists, if it doesn't I create the datatable for the cart and store it in the session.  I then have a datalist control that contains all the information for my products including an "add to cart" button.  When the page loads everything looks fine.  If I click on an "add to cart" button nothing happens to the session information.  If I click on it again, the session information updates - displaying only one item is in the cart and then counts up correctly there after.  Additionally, after adding an item, if I select a different item in the list, the same issue occurs.  I am not sure why this is happeing, if anyone can give me an idea I would appreciate it. 


holding datatable value using session

  

Hi,

iam insert record using datable in gridivew,iam using  session to hold the record,

there is any other way to hold the record in datable.

dtempty.Columns.Add("storeid");   
        dtempty.Columns.Add("ratetypeid");
        dtempty.Columns.Add("ratedesc");
        dtempty.Columns.Add("slabs");   
        dtempty.Columns.Add("days");
        dtempty.Columns.Add("rate");
        dtempty.Columns.Add("contid");
        dtempty.Columns.Add("continertype");

        DataRow row;
        row = dtempty.NewRow();
         
        row["ratetypeid"] = ddlratetype.SelectedValue;
        row["ratedesc"] = ddlratetype.SelectedItem.Text;
        row["slabs"] = ddlslabs.SelectedValue;   
 &n

removing item from datatable

  

hi to all ..thanks in advance

 

I have Two datatables dtA,dtB ,both contains column name is "FiledName" I need to remove item

from dtA when same row data exists in dtB.  please tell me how to do it

dtA    dtB   

 A        A

 B        F

 C        C

 D        Z

I want o/p like this

0/p

dtA

   B

   D

 

 


How to extract a schema from a sql server database

  

Hi,

  I need to extract or get the schema from tables in my databse and what is the best way to do it. Is there any third party tool to do it??

 

Any idea will be appreciated..

Thanks

Karen


Categories: 
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