473,383 Members | 1,829 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,383 software developers and data experts.

DataTable in a DataSet

Hello all
foreach(DataTable myTable in m_DsConfig.Tables)
{
if(myTable.TableName == "DataSourceCodeView")
{
len = myTable.Rows.Count;
}
}
I am trying to get the number of rows in a datatable that
is contained by a dataset. I am always getting a value of
zero for the number of rows and I know that is not correct.
Can you help me with using the correct property or method?

I am trying to get a valid count from the following piece
of code also. But no success so far.

foreach(DataTable myTable in m_DsConfig.Tables)
{
if(myTable.TableName == "DataSourceCodeView")
{
DataRow[] Rows = myTable.Select("Parameter
= 'MyTestParam'");
int len = Rows.Length;
}
}

Thanks a lot for your help.

Nov 16 '05 #1
2 1506
The code looks correct. Are you sure there are tables in there to start with

foreach(DataTable myTable in m_DsConfig.Tables

if(myTable.TableName == "DataSourceCodeView"

Console.WriteLine(myTable.ToString()); // Do some testin
len = myTable.Rows.Count

Nov 16 '05 #2
yes i'm sure. there are tables in it. I will do more
testing. thanks.
-----Original Message-----
The code looks correct. Are you sure there are tables in there to start with?
foreach(DataTable myTable in m_DsConfig.Tables)
{
if(myTable.TableName == "DataSourceCodeView")
{
Console.WriteLine(myTable.ToString()); // Do some testing len = myTable.Rows.Count;
}
}

.

Nov 16 '05 #3

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

Similar topics

0
by: Chris Ericoli | last post by:
Hi, I am working with an 'in session' ado dataset with an asp.net application. My dataset is comprised of two tables, one of which maintains a few calculated datacolumns. For some reason these...
3
by: Jon | last post by:
I'm learning about datatables. When using the example provided by MS in the ..NET Framework Class Library for DATATABLE (see below) I get an error on line 3 that says "Type expected". Is something...
10
by: dauphian | last post by:
Hello, I am new to .net and am trying to build a report application that queries 4 different tables based on a id, and I need to return them in the same table for easy viewing. Basically, I...
3
by: Tom | last post by:
I have a dataTable being returned from my datalayet, I need to convert it to a dataSet so I can do some data manipulation to it prior to populating my datagrid. How can I convert the datatable to a...
9
by: Anil Gupte | last post by:
After reading a tutorial and fiddling, I finally got this to work. I can now put two tables created with a DataTable class into a DataRelation. Phew! And it works! Dim tblSliceInfo As New...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.