nzfire
asked on
SQL Queries and Stored Procedures
Hi All,
I would like to use the datareader and the sqlconnection to access records in my db. I am brand new to .net and have an application to convert.
What is the most efficient data access method??
Could someone give me an example of a complete SUB where a connection is made and then a dataset/ datareader is populated from a stored proc with parameters.
Sorry I don't have my code in front of me.
What is the deal with tableadapters? Are they efficient? I am using a direct connection to the DB by the way.
Thanks
I would like to use the datareader and the sqlconnection to access records in my db. I am brand new to .net and have an application to convert.
What is the most efficient data access method??
Could someone give me an example of a complete SUB where a connection is made and then a dataset/ datareader is populated from a stored proc with parameters.
Sorry I don't have my code in front of me.
What is the deal with tableadapters? Are they efficient? I am using a direct connection to the DB by the way.
Thanks
tableadapters(use to fill a dataset) are efficient but datareaders are more
But if you open a datareader the connection used is not re-usable by aything untill you close the datareader. Not particularly fond of datareaders myself.
Yeah, but DataReaders are very light-weight, if you only need read-only data.
Bob
Bob
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
here is an article with source code that explains scenario in which a connection is made and then a dataset/ datareader is populated
http://www.startvbdotnet.com/ado/sqlserver.aspx
http://www.csharpfriends.com/Articles/getArticle.aspx?articleID=1
To read difference in dataset and datareader check:
http://www.sitepoint.com/article/dataset-datareader
http://www.eggheadcafe.com/forums/ForumPost.asp?id=67487&ThreadID=67487&INTID=14