When I check the syntax of dataset, It seems that dataset can only read data
from file. (e.g., datset.read(str ing filename), dataset.readxml (string
filename)).
If I have a string with XML format that is transfered from somewhere else,
how can I read the string and populate it into a dataset, then display the
data in a data grid?
Thanks for any help.
David 6 1724 http://www.google.com/search?hl=en&q...+to+dataset%22
There's good info in the links returned by that Google query.
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
=============== =============== =====
"david" <da***@discussi ons.microsoft.c omwrote in message
news:A2******** *************** ***********@mic rosoft.com...
When I check the syntax of dataset, It seems that dataset can only read data
from file. (e.g., datset.read(str ing filename), dataset.readxml (string
filename)).
If I have a string with XML format that is transfered from somewhere else,
how can I read the string and populate it into a dataset, then display the
data in a data grid?
Thanks for any help.
David
I have searched Yahoo and Microsoft web, some info seems useful but doesn't
work.
I will try to find some.
David
"Juan T. Llibre" wrote: http://www.google.com/search?hl=en&q...+to+dataset%22
There's good info in the links returned by that Google query.
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
=============== =============== =====
"david" <da***@discussi ons.microsoft.c omwrote in message
news:A2******** *************** ***********@mic rosoft.com...
When I check the syntax of dataset, It seems that dataset can only read data
from file. (e.g., datset.read(str ing filename), dataset.readxml (string
filename)).
If I have a string with XML format that is transfered from somewhere else,
how can I read the string and populate it into a dataset, then display the
data in a data grid?
Thanks for any help.
David
Here's a quick example :
<%@ Import Namespace="Syst em.Data" %>
<script runat="server">
sub Page_Load(sende r as Object, e as EventArgs)
Dim myDataSet as New DataSet()
myDataSet.ReadX ml(Server.MapPa th("some.xml") )
dgSome.DataSour ce = myDataSet
dgSome.DataBind ()
end sub
</script>
<body>
<asp:datagrid id="dgSome" runat="server" />
</body>
If you are getting the XML from a stream,
you'll need to write it to disk before using this method.
That shouldn't present too many complications.
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
=============== =============== =====
"david" <da***@discussi ons.microsoft.c omwrote in message
news:81******** *************** ***********@mic rosoft.com...
>I have searched Yahoo and Microsoft web, some info seems useful but doesn't
work.
I will try to find some.
David
"Juan T. Llibre" wrote:
>http://www.google.com/search?hl=en&q...+to+dataset%22
There's good info in the links returned by that Google query. Juan T. Llibre, asp.net MVP asp.net faq : http://asp.net.do/faq/ foros de asp.net, en español : http://asp.net.do/foros/ ============== =============== ====== "david" <da***@discussi ons.microsoft.c omwrote in message news:A2******* *************** ************@mi crosoft.com...
When I check the syntax of dataset, It seems that dataset can only read data
from file. (e.g., dataset.read(st ring filename), dataset.readxml (string filename)).
If I have a string with XML format that is transfered from somewhere else,
how can I read the string and populate it into a dataset, then display the
data in a data grid?
Thanks for any help.
David
Incase you have yr xml in the form of a string and not a physical .xml file
on the server, in that case you could try this option.
Load the string into an StringReader object and the same can be passed to
the ReadXml method of the dataset.
StringReader strReader = new StringReader(st r);
DataSet _ds = new DataSet();
_ds.ReadXml(str Reader);
Response.Write( _ds.GetXml());
This should work.
Thanks
I will try your stringreader.
David
"Parvathy Padmanabhan" wrote:
Incase you have yr xml in the form of a string and not a physical .xml file
on the server, in that case you could try this option.
Load the string into an StringReader object and the same can be passed to
the ReadXml method of the dataset.
StringReader strReader = new StringReader(st r);
DataSet _ds = new DataSet();
_ds.ReadXml(str Reader);
Response.Write( _ds.GetXml());
This should work.
Thanks for all of you.
StringReader makes the program work.
David
"Parvathy Padmanabhan" wrote:
Incase you have yr xml in the form of a string and not a physical .xml file
on the server, in that case you could try this option.
Load the string into an StringReader object and the same can be passed to
the ReadXml method of the dataset.
StringReader strReader = new StringReader(st r);
DataSet _ds = new DataSet();
_ds.ReadXml(str Reader);
Response.Write( _ds.GetXml());
This should work.
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Goldsworth_Systems |
last post by:
I have a string containing valid XML.
How do I populate a dataset based on the string, without reference to an XML
schema or writing the XML to file and reading it back in again?
|
by: Sharon |
last post by:
I have successfully loaded a DataSet object with a XML schema (XSD).
Now I wish to populate the tables that was created in the DataSet.
I have an XML file/string that contain all the needed data in the same
format as the XSD (the XML file/string was created using this same schema).
The XML file/string may contain data for a single table or for several
tables at once.
The question is:
|
by: Mike L |
last post by:
I tried a sample of code in MSDN magazine, but now I'm stuck. What code has
the best performance to populate a Data Grid with a SP? Below is the code I
have, which might be completing the wrong way to populate a data grid. I
like using code and not the server explorer. (I replaced the sa password for
this post.)
private void frmDealerSearch_Load(object sender, System.EventArgs e)
{
string sConnString = "Data
|
by: Yul |
last post by:
Hi,
We are in the process of designing an ASP.NET app, where a user will
enter some 'Customer ID' to be queried in the database. If the ID is
valid, several stored procedures will be called to populate multiple
webpages containing customer information. There isn't a one-to-one
correlation between the stored procedure and a webpage. In other
words, a webpage may have to refer to 1 or more DataTables to populate
itself. Therefore, a...
|
by: crjunk |
last post by:
I have 4 different databases that I'm having to pull data from in order
to populate a datagrid. I am able to do this, but my problem is that
because I'm pulling the data from 4 different databases, the data is
ordered alphabetically but is grouped by database.
Here is an example of what is happening to the data in the datgrid with
the code that I have now.
DB1 Apple
DB1 Bird
DB1 Cake
| |
by: Paul D. Fox |
last post by:
I would like to read from Active Directory and populate a dataset to be
passed in a Web Service. I can get the data from AD just fine, but can I
populate a dataset with these values and do a "Return dataSetName" in my web
service?
|
by: Mike Fellows |
last post by:
when i load my windows form i populate a combobox i use the code below
Dim conn As New System.Data.SqlClient.SqlConnection(strConn)
Dim sql As String = "AllLenders"
Dim da As New System.Data.SqlClient.SqlDataAdapter(sql, conn)
Dim ds As New DataSet()
da.Fill(ds)
ComboBox1.DataSource = ds.Tables(0)
ComboBox1.DisplayMember = "Lender"
da.Dispose()
|
by: paumierj |
last post by:
Hi there
Here's my question :
I'd like to populate a dataset from an XML string, ie:
Dim sXmlString As String
sXmlString = "<root type='E-Form'><question label='This is my first
question'></question><question label='This is my second
question'></question></root>
|
by: Tim Kelley |
last post by:
Is it possible to populate a grid using code (not binding it to a
datasource). Is there something like an additem method?
Thanks,
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |