473,569 Members | 2,782 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dataset & Datareader

Hello,

How can I get Random data from Dataset or datareader
THanks

--
Regads,
Rochdi
Nov 21 '05 #1
4 1916
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**@discussio ns.microsoft.co m> escribió en el mensaje
news:5B******** *************** ***********@mic rosoft.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).ro ws.count -1

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

A row is than
dim myrandowrow as datarow = ds.tables(0)(th erandomizerfoun dnumber)

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
3123
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 a DataAdapter to more easily load the DataSet,but that would entail loading a couple of gigs worth of datainto memory at once, which is bound to be...
6
1873
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 between one fo the 2 in my page ? 2) i am creating a " forgot my password" page- and i want to execute a query based on the email address entered in my...
2
1243
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 values of columns of returned rows to Labels in the client aplication such as: while (dtrJobDetails.Read()) { l_shortjobdesc.Text =...
14
2228
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 should be up to date. However, both the IbuySpy and Duwamish samples and most, if not all, the shopping cart sample codes I've seen use dataset to...
2
1720
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 data to other pages that would call it. I'd return the data as arrays so that I wouldn't have to have my DB connections open all the time while the...
1
1657
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 to work on. I know that the DataReader is more efficient and faster than a dataset, but I was not able to figure out how to implement it. Here is...
11
1704
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. I then return the DS and bind the tables to the relevant controls. I've been reading that DataReaders are much more efficient than DS's for...
2
2379
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 record like string manipulation, or taking the data for insertion into another table, etc.. Here's the function that returns the data as an ArrayList....
7
3792
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 the changed? I'm using VS2005 with .net 3.0.
0
7612
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8120
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7672
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6283
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5512
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5219
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1212
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
937
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.