Click here to Skip to main content
15,889,861 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
how i can copy from row number 1 to row number 6 in datatable
to DataReader
thnx for any help
Posted
Comments
Manfred Rudolf Bihy 30-Dec-10 18:47pm    
"To DataReader"? I thought a DataReader was a source and not a destination. Please explain more clearly. Do you have any code samples to show us?
Mostafa Elsadany 30-Dec-10 19:11pm    
public void x(OracleDataReader dr,DataTable tbl,int start,int end)
{

dr = tbl;// from start row to end row


}

this code is not valid but for explain

use SQLCommand.ExecuteReader just like:

Dim reader as DataReader = command.ExecuteReader
 
Share this answer
 
Comments
Mostafa Elsadany 30-Dec-10 19:45pm    
thnx
but
i want fill datareader from datatable
Ankur\m/ 13-Jan-11 5:39am    
[moved from answer]
Ali Al Omairi wrote:
sorry, for miss understanding i thought that the table was in a database.
but if you have it read then why to read in again.
mostafa.elsadany wrote:
some case need to read from datatable into datareader
Ankur\m/ 13-Jan-11 5:40am    
Discussions come as a comment and not answer.
Ali Al Omairi(Abu AlHassan) 19-Jan-11 13:41pm    
Sir, this is not of your business. Thank you.
Ankur\m/ 19-Jan-11 23:33pm    
Do you see that I have the powers to move your comments? And that's there for a reason.
Please read the FAQ's and follow the site policies.
Answer doesn't notify a 'commenter' but comment does. So it's quite possible the user may not know about your answer.
Add answer only if you are answering the question everything else goes into comment section.

Thank you for understanding.
sir, i can find no solution for your case other than implementing IDataReader interface (since DataReader is a connented Class and can not read from disconnected classes).
 
Share this answer
 
Comments
Mostafa Elsadany 30-Dec-10 21:14pm    
thnx for help
but i want inherit datapadater
in new class and add new methods this cass
and i have many problem
so i will add new qustion you can see that
and thnx for aall help
A Little research and you can do it by using the following example

reading contents from a datatable to datareader[^]
 
Share this answer
 
v2
Comments
Mostafa Elsadany 13-Jan-11 6:19am    
no i want take from datatable to datareader
Ali Al Omairi(Abu AlHassan) 19-Jan-11 16:48pm    
thak you sir, i didn't know before. but why do you thing reading a datatable already loaded in memory can be useful.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900