whats the best method to use when receiving information from a database? Datasets, DataReader, Datarow etc. Which provides the effecient way to access your database?
whats the best method to use when receiving information from a database? Datasets, DataReader, Datarow etc. Which provides the effecient way to access your database?
The greatest discovery of all men through lifetime is that a man can alter his life by altering his attitude!
If you are using sql server, then stored procedures is the best solution, as the bulk of the work is done by pre-compiled code (t-sql) in the database.
I do recall you can write queries in access. You can then call them from your program. It behaves like stored procedures but their not the same. The purpose of having queries separate from your program is a means to lessen the dependence of your program on the structure of the database.
To be honest, i am not an access man, i use mostly sql server and mysql so don't quote me.
Access sucks period if your coding a separate application in VB.NET. If you use VBA in Access, thats a whole other story. It's pretty powerful on it's own, but i rarely ever use it. If i am working on a small project where security is not a concern, i use XML. May not be as efficient, but i get less headaches.
Last edited by psybuck2002us; Oct 7, 2007 at 08:48 PM.
well I know access aint powerful, I mostly use sql server but you still have to put into consideration about organisations who uses ms access.
The greatest discovery of all men through lifetime is that a man can alter his life by altering his attitude!
regardless of whether u use access, sqlserver or any other database for that matter, DataReader will retrieve bulk data faster than DataAdapter.
the primary reason is because DataAdapters use data readers to fetch their data, then do additional functions to create the datatable.
so in essence :
DataReader = Read data and return it as readonly stream (easy)
DataAdapter = Read data and return it, then instantiate tables and configure columns and create events and attach them and call them when columns are changed and rows are added and check that the data being assigned matchs the type for the column and check constraints and references to other tables[/HTML]
Cultured in Aggression and Koding like a Warrior!!
“Common sense is instinct. Enough of it is genius.” - George Bernard Shaw.
"The significant problems we face cannot be solved by the same level of thinking that created them." - Albert Einstein
Oh zeen but datareader lacks certain functionalities! So thats why you only use datareader in specific instances and the latter in other!
The greatest discovery of all men through lifetime is that a man can alter his life by altering his attitude!