473,396 Members | 1,998 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.

Implementation of SqlDataReader and ExecuteReader

Hello:

I am trying to understand the implementation of SqlDataReader and
ExecuteReader. I know how to use them in C#. But my real interest is to
know how those APIs themselves are written.

Say my Table has the following columns
Phone #(xxx-xxx-xxxx), Name(String), Month(1-12),
Balance(0.00-999,999.99)

Assume I have a Recordset pointing to rows of data in the format above.
My intention is to understand how are the APIs themselves implemented.
Do they create a class on demand with all the necessary
datatypes(because they know what datatypes their compiler supports
before compile time) and then go on reading from table.

Alternatively can everyting be read as a "string" ir-respective of the
format and the CASTED to respective format ?

I am not sure these are my guesses, can someone shed some light ?

Thanks.

Nov 17 '05 #1
1 1801
i think, it retrieves column metadata from the dbms, and map it to internal
..net datatypes. for example char, nchar, varchar, nvarchar is represented in
..net as string, while datetime, smalldatetime represented as DateTime. i
think it retrieves column type information of the query result from
database. if you investigate datareader-dataparemter.Value objects from
command window, you can see they have a property something like "Underlying
System Type".
Nov 17 '05 #2

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

Similar topics

2
by: Rod | last post by:
Thanks in advance. I have two listboxes on a single asp page. I am trying to use sqldatareader to populate both using two seperate sql stored procs. I can populate each box seperately using...
3
by: Jarmo Muukka | last post by:
Hello, I have an interface which has a method which returns an interface. I would like to return a real type in implemented class. interface IFoo { .... }
2
by: TN Bella | last post by:
PLEASE HELP!! I am so far behind....and it doesn't help that I am learning all this stuff. I am using .net framework 1.0 from WebMatrix. These parameters get me all confused...someone please help!...
4
by: mimi | last post by:
Hi Please help me out, I can't find a way to close a sqldatareader when error occur at statement cmd.ExecuteReader(). I can't close it in catch because it is local in try scope and I can't...
2
by: SQL | last post by:
I'm new at this, so please forgive me if my question has a simple answer to it. I'm trying to get a value out of a SqlDataReader. Here is my code to do so: Dim mySQLCommand As New...
7
by: Web learner | last post by:
I am trying to create a method GetDataFor(string column) becaues I have to repeat the same statements for several columns but I get an error as follows: The name 'dr' does not exist in the current...
4
by: Learner | last post by:
Hello, This my a method to call a stored proce and uses a DataReader to read the data in the below method I am trying to assign a null value to my datareader variable Dim datareader As...
0
by: coosa | last post by:
Dear all; My code is is a bit long but is modular at least. I'm attempting to implement the depth first search for an application that is supposed to: 1- Fetch based on an ID from the database a...
3
by: yogarajan | last post by:
hi i am using two sqldatareader. that gives error My code start here SqlConnection conn = new SqlConnection("Data Source=**********;Initial Catalog=****; User Id=****; Password=******"); ...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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,...

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.