473,399 Members | 3,401 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,399 software developers and data experts.

How to convert a datareader to a dataview

Hi All,
Which way is the best way to convert a datareader to a
dataview?

Thanks,

Peter
Nov 18 '05 #1
3 5525

"Peter Yin" <an*******@discussions.microsoft.com> wrote in message
news:03****************************@phx.gbl...
Hi All,
Which way is the best way to convert a datareader to a
dataview?


You can't, once you have the DataReader, it's too late.

You need to use a DataAdapter intead, and fill a DataTable. Then build a
DataView from the DataTable.

DataCommand > DataAdapter > DataTable > DataView.

David
Nov 18 '05 #2
A DataView is a property of a DataTable. You can either read the contents of
your DataReader into a DataTable, or use a DataSet or DataTable initially,
rather than a DataReader.

--
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Peter Yin" <an*******@discussions.microsoft.com> wrote in message
news:03****************************@phx.gbl...
Hi All,
Which way is the best way to convert a datareader to a
dataview?

Thanks,

Peter

Nov 18 '05 #3
I see. Thanks a lot you guys.
Peter
-----Original Message-----

"Peter Yin" <an*******@discussions.microsoft.com> wrote in messagenews:03****************************@phx.gbl...
Hi All,
Which way is the best way to convert a datareader to a
dataview?

You can't, once you have the DataReader, it's too late.

You need to use a DataAdapter intead, and fill a

DataTable. Then build aDataView from the DataTable.

DataCommand > DataAdapter > DataTable > DataView.

David
.

Nov 18 '05 #4

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

Similar topics

1
by: Al | last post by:
in order to implement sorting, paging in a datagrid, can I have the datasource of the datagrid a datareader or it must be a dataset then I create a dataview and make it a datasource of the...
12
by: Thomas Scheiderich | last post by:
I have 2 dropdowns that are exactly the same and I don't want to re-read for each. Is there a way to do something like below where I read the data, bind to depCity1 and then bind to destCity2. ...
7
by: Bart Schelkens | last post by:
Hi, I have 2 more questions : 1. Can I fill a datagrid by using a DataReader or does it have to be a DataSet or a DataView? 2. In my datagrid I need to display two images and one of does...
20
by: Mark | last post by:
Hi all, quick question , a DataView is memory resident "view" of data in a data table therefore once populated you can close the connection to the database. Garbage collection can then be used to...
7
by: Arsalan | last post by:
I have a function which return datareader Public Shared Function ReturnDReader(ByVal query As String) As OleDbDataReader Dim Connection_String As String =...
3
by: Vu Doan Hung | last post by:
I want to change this Class to VB.NET Class, can you help me ? using System; using System.Windows.Forms; using System.Drawing; using System.Data;
7
by: Hardik Shah | last post by:
Hi, Generaly to populate combobox , I use following command :- Combobox1.datasource = dataset.tablename combobox1.displaymember = fieldname1 combobox1.valuemember = fieldname2 As I don't...
4
by: Tedmond | last post by:
Dear all, How to code a Web Service function that returns either a DataTable or DataReader to the clients? Or I should use other alternative? Thanks for any help! Tedmond
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
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...
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
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...
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.