Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

.NET Forum


You are currently viewing our .NET Forum as a guest. Please register to participate.
Login



Reply
how to check EOF in .net ?
Old 02-11-2006, 10:54 AM how to check EOF in .net ?
Ram
Novice Talker

Posts: 12
Trades: 0
i have used msaccess as backend and front end as .net
i want to check status of records (i.e EOF and BOF)
i don't know how to check?
using DAtASET or ADO.net
if ADO.net how to do it
__________________
Editor

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
Ram is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 02-11-2006, 12:45 PM Re: how to check EOF in .net ??????????
Minaki's Avatar
Defies a Status

Posts: 1,626
Location: Guildford, UK
Trades: 0
For a dataaset, to check for rows, you can just use
Code:
if (MyDataSet.Tables[0].Rows.Count > 0)
{
    // then the DataSet has rows
}
__________________
Minaki Serinde MCP
"Wow, Linux is nearly on-par with Windows ME!"

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
Minaki is offline
Reply With Quote
View Public Profile Visit Minaki's homepage!
 
Old 02-12-2006, 02:27 AM Re: how to check EOF in .net ??????????
Ram
Novice Talker

Posts: 12
Trades: 0
thnks minaki. thanks for u r kind consideration
__________________
Editor

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
Ram is offline
Reply With Quote
View Public Profile
 
Old 05-17-2006, 01:25 AM Re: how to check EOF in .net ?
rajkiran's Avatar
Junior Talker

Posts: 2
Trades: 0
There are many ways to do this

with dataset

it is just the same

if(dataset.tables.rows.count > 0)

with datareader

it

objreader.hasrows
__________________
Thanks

Please login or register to view this content. Registration is FREE
rajkiran is offline
Reply With Quote
View Public Profile Visit rajkiran's homepage!
 
Old 05-17-2006, 11:36 AM Re: how to check EOF in .net ?
Experienced Talker

Posts: 30
Trades: 0
In fact, if you only need to read through every record without modifying their contents, you may consider using datareader because its performance is faster than using dataset in general.

e.g.

[Visual Basic]
Dim myReader As SqlDataReader = myCommand.ExecuteReader()
.....
If myReader.HasRows Then
Do While myReader.Read()
Console.WriteLine(vbTab & "{0}" & vbTab & "{1}", myReader.GetInt32(0), myReader.GetString(1))
Loop
Else
Console.WriteLine("No rows returned.")
End If
myReader.Close()

[C#]
SqlDataReader myReader = myCommand.ExecuteReader();
.....
if (myReader.HasRows)
while (myReader.Read())
Console.WriteLine("\t{0}\t{1}", myReader.GetInt32(0), myReader.GetString(1));
else
Console.WriteLine("No rows returned.");
myReader.Close();
__________________

Please login or register to view this content. Registration is FREE
MyOpinion is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to how to check EOF in .net ?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.15031 seconds with 12 queries