473,396 Members | 2,061 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,396 software developers and data experts.

Dataset & Datareader

Hello,

How can I get Random data from Dataset or datareader
THanks

--
Regads,
Rochdi
Nov 21 '05 #1
4 1903
Mike,

How can I get Random data from Dataset or datareader

Can you explain more what you mean with this. (as well if you are talking
about if this is a winform or a webform application).

A dataSet uses a dataadapter to fill its tables, where the datadapter uses a
datareader object.

Cor
Nov 21 '05 #2
Unless your select statement has an "ORDER BY" clause, the data from the
database is not guaranteed to be ordered. If you really need things of
random nature, use the System.Random class of the .NET Framework.

--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
You can code, design and document much faster.
Free resources for add-in developers:
http://www.mztools.com

"Mike" <Mi**@discussions.microsoft.com> escribió en el mensaje
news:5B**********************************@microsof t.com...
Hello,

How can I get Random data from Dataset or datareader
THanks

--
Regads,
Rochdi

Nov 21 '05 #3
It just a normal winform and the dataset or datareader is getting data from a
table. how can I get random rows from this dataset or reader
--
Regads,
Rochdi
"Cor Ligthert [MVP]" wrote:
Mike,

How can I get Random data from Dataset or datareader

Can you explain more what you mean with this. (as well if you are talking
about if this is a winform or a webform application).

A dataSet uses a dataadapter to fill its tables, where the datadapter uses a
datareader object.

Cor

Nov 21 '05 #4
Mike,

In addition from Carlos, the data is not ordered however the data will
always be supplied in the same way.

Every dataset has datatables which have rows. The rows is what you need to
get with the again as Carlos told used randomizer to get a number from 0 to
ds.tables(0).rows.count -1

http://msdn.microsoft.com/library/de...classtopic.asp

A row is than
dim myrandowrow as datarow = ds.tables(0)(therandomizerfoundnumber)

I hope this helsp,

Cor

Nov 21 '05 #5

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

Similar topics

1
by: Rob via .NET 247 | last post by:
Ok, I'm new to .NET so I'm afraid I'm doing something stupidhere, but I'm trying to populate a DataSet manually from aDataReader, and its turning out to be ridiculously difficult. Yes, I could use...
6
by: nabil m | last post by:
hi , i have been looking around on msdn and google but i still have a couple of oquestions about the difference between a datareader and a dataset - which to use when - 1) do i have to choose...
2
by: Sumaira Ahmad | last post by:
Hi All My Web Service is returning a DataSet. I realized that we cannot return a DataReader.. Normally we can use a DataReader( when not using Web services) and access it as below to assign...
14
by: Bihn | last post by:
I was reading about datareader which is said to be slimmer & faster then dataset. Since the datareader have to go fetching the dat from the database every time it need it, the data it gets then...
2
by: Patreek | last post by:
Hi, I'm writing my first real asp.net app at my job, and I'd like opinions please. In my classic ASP apps that I've written, I'd often have separate files for retreiving data and returning the...
1
by: Ivan Weiss | last post by:
Hey all, I have the following code to populate a ListView control from my Access database. The listview is displaying a list of saved projects that the user will be able to open, edit, or delete...
11
by: ^MisterJingo^ | last post by:
Hi all, I have a form with 4 dropdownlist controls which I populate with data from DB tables. I have a class with a method which constructs a dataset, putting each DB table into a dataset table....
2
by: =?Utf-8?B?ZGJhMTIz?= | last post by:
Note, I'm using C# I am wondering what type of control I should use for iterating through the set of records returned by callin this method below, so that I can then do some stuff with each...
7
by: =?Utf-8?B?UGV0ZXI=?= | last post by:
I have read some articles state that DataSet should NOT be used for large resultset. What does "large" mean? Is "large" based on # of rows/columns and/or memory required to hold the original and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
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
Oralloy
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,...
0
jinu1996
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...
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
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,...
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.