473,497 Members | 2,041 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to find DataSet has any values

hi all,

In ASP.Net , i'm using a dataset. I want to find whether it has any values
or not. How to do that?

Thanks in advance.

Regards,
Gomathi
Nov 22 '05 #1
3 1183
Hello Gomathi,
here are some example of it. lets say your dataset name is "ds" then,

ds.Tables.Count returns number of tables in dataset
ds.Tables[0].Rows.Count returns number of rows in first tables
ds.Tables[0].Rows[0][0] return value of first table's first row's first column.
Mihir Solanki
http://www.mihirsolanki.com
hi all,

In ASP.Net , i'm using a dataset. I want to find whether it has any
values or not. How to do that?

Thanks in advance.

Regards,
Gomathi

Nov 22 '05 #2
Gomathi,
You can find it using rows count. Using below code you can find the
dataset has values or not
DataSet dsEmp= new DataSet("Employees");
int intCount = dsEmp.Tables[0].Rows.Count;
"Gomathi" wrote:
hi all,

In ASP.Net , i'm using a dataset. I want to find whether it has any values
or not. How to do that?

Thanks in advance.

Regards,
Gomathi

Nov 22 '05 #3
Thanks all.
Its working fine for me.

Gomathi
"Gomathi" <go*****@celtycs-consulting.com> wrote in message
news:uM**************@tk2msftngp13.phx.gbl...
hi all,

In ASP.Net , i'm using a dataset. I want to find whether it has any values
or not. How to do that?

Thanks in advance.

Regards,
Gomathi

Nov 22 '05 #4

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

Similar topics

1
3723
by: John Lee | last post by:
Hi, When I use DataSet.WriteXml(filename, XmlWriteMode.DiffGram), the xml file contains current values (at <InvDataSet> node) and original value (at <diffgr:before> node) - this means the...
15
2225
by: JIM.H. | last post by:
Hello, Can I send a dataset as a parameter into stored procedure and import data to a table in the stored procedure? Thanks, Jim.
1
1534
by: Joey Lee | last post by:
Hi, I am confused as what the DataSet Merge() function does. Currently I have two datatable which was selected from different table in mssql. Now with both different datatable. there are...
1
2821
by: Matt Tinson | last post by:
Hello I have a datagrid with a datetimepicker column in it, which is bound to a dataset (MyDataset). The column in the dataset set that is mapped to the datetimepicker is called MyOrderDate and...
1
2613
by: Ramakrishnan Nagarajan | last post by:
Hi, I am converting Excel data into a Dataset in C#. There are around 24 columns in the Excel Sheet. First I tried to insert one row with correct values in the Excel sheet. i.e. for text columns...
0
1164
by: BVA3105 | last post by:
i update a database with a dataset and a SqlAdapter with success but when i clear and refill my dataset i always retreive the old values. I have to wait for 5 seconds to get the corrects values. ...
2
2444
by: =?Utf-8?B?UmljaA==?= | last post by:
Greetings, I need to locate a row (or see if it exists) in a table contained in a dataset. The DataView.Find method seems to work OK for one criteria but I need to use 2 criterias. Is there...
2
4189
by: dave | last post by:
Hi, I have searched for the answer for this error message without success. I have seen the question many times though:) I create an ASP.NET project (VS 2005, C#), and use a very simple .mdf...
1
1761
by: pekbob1 | last post by:
Hi Everybody I have the error (ObjectDataSource 'ObjectDataSource1' could not find a non-generic method 'UpdatePre' that has parameters: Comp, Job_Number, Request_Date, Customer, Contact_Name, Tel,...
0
7121
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,...
1
6881
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
5456
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4899
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...
0
3088
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...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1411
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 ...
1
650
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
287
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.