473,414 Members | 1,563 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

Reading rows out a dataset

jed
Hello what i have done here is read an xml file into a untyped
dataset. the values i can see in a datagrid but how would i gain
access to these rows, they are in a txt format in the dataset.
Here are some of the xml values
DayNumber="0" First="2964" Last="1">
<Value Index="0">- 3.8 mA</Value>
<Value Index="1">- 3.8 mA</Value>
<Value Index="2">- 3.8 mA</Value>
<Value Index="3">- 3.8 mA</Value>
<Value Index="4">- 3.8 mA</Value>
<Value Index="5">- 3.8 mA</Value>
<Value Index="6">- 3.8 mA</Value>
<Value Index="7">- 3.8 mA</Value>
<Value Index="8">- 3.8 mA</Value>
<Value Index="9">- 3.8 mA</Value>
Here is the code:
public Form1()
{
InitializeComponent();
string xml = "C:\\WirelessXML.xml";

dataSet1.ReadXml(xml);
}

private void button1_Click(object sender, EventArgs e)
{
dataGridView1.DataSource = dataSet1;
dataGridView1.DataMember = "Value";

}
How do i find out what the tablename is and how do i obtain the data
in the rows and be able to work with it please help.thanks

Aug 3 '07 #1
2 2679
On Fri, 03 Aug 2007 13:24:37 +0200, <je*@auto-soft.co.zawrote:
Hello what i have done here is read an xml file into a untyped
dataset. the values i can see in a datagrid but how would i gain
access to these rows, they are in a txt format in the dataset.
Here are some of the xml values
DayNumber="0" First="2964" Last="1">
<Value Index="0">- 3.8 mA</Value>
<Value Index="1">- 3.8 mA</Value>
<Value Index="2">- 3.8 mA</Value>
<Value Index="3">- 3.8 mA</Value>
<Value Index="4">- 3.8 mA</Value>
<Value Index="5">- 3.8 mA</Value>
<Value Index="6">- 3.8 mA</Value>
<Value Index="7">- 3.8 mA</Value>
<Value Index="8">- 3.8 mA</Value>
<Value Index="9">- 3.8 mA</Value>
Here is the code:
public Form1()
{
InitializeComponent();
string xml = "C:\\WirelessXML.xml";

dataSet1.ReadXml(xml);
}

private void button1_Click(object sender, EventArgs e)
{
dataGridView1.DataSource = dataSet1;
dataGridView1.DataMember = "Value";

}
How do i find out what the tablename is and how do i obtain the data
in the rows and be able to work with it please help.thanks

Hi,

You don't need the tablename to access the rows as you can just use DataSet.Tables[0].Rows. The TableName is accessible the same way DataSet.Tables[0].TableName.
--
Happy coding!
Morten Wennevik [C# MVP]
Aug 3 '07 #2
jed
Thanks very much

Aug 3 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Bill C. | last post by:
Hi, I've got a simple console app that just reads an XML file into a DataSet then prints out a description of each table in the DataSet, including column names and row values for each column. ...
1
by: David D. McCrory | last post by:
I have the following that returns an array of a struct and I want to load it into a DataSet on the consumer side.....Can someone provide me with an example of how to use the DataSet.ReadXml()...
5
by: Scott M. Lyon | last post by:
I've just discovered a bug in some code I wrote a little while ago, and I need you guys' help to fix it. My program imports data from a standard Excel Spreadsheet (just with specific column...
1
by: hzgt9b | last post by:
(FYI, using VB .NET 2003) Can someone help me with this... I'm trying to read in an XML file... it appears to work in that the DataSet ReadXML method dose not fail and then I am able to access the...
6
by: Camper Joe | last post by:
Here's my code: Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Dim db As New SqlConnection Dim strSQL As String = "SELECT * FROM users WHERE strUsername = '" &...
4
by: Amit Maheshwari | last post by:
I need to read text file having data either comma seperated or tab seperated or any custom seperator and convert into a DataSet in C# . I tried Microsoft Text Driver and Microsoft.Jet.OLEDB.4.0...
0
by: c.w.browne | last post by:
Hi, Ive had a bit of a look around for other people with this problem and cant find anything that solves it in my case, so I'm afraid im going to have to bother you all with a post of my own. ...
9
by: dba123 | last post by:
I need some help and direction on what classes and an example or two (article) on how to read an Excel Worksheet and insert one column into a database table column. I am using .NET 2.0 only. What...
0
by: David | last post by:
Hi, using C# 1.1 I am writing a winform app that collects a dataset from a webservice. At the same time I collect the data, I write the dataset out to the local disk using DataSet.WriteXml,...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
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,...
0
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...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.