Whats the best way in .Net to connect to an Access database ?:confused:
Printable View
Whats the best way in .Net to connect to an Access database ?:confused:
It is through the OleDbConnection object.
Then you have 2 possibilities, either ADO in connected mode or ADO in disconnected MODE.
Connected mode uses a Command with a DataReader to read through the data in a fashion a lot like old ADO in vb6.
Disconnected mode fills a Dataset with information from a DataAdapter. You then can use the data in a disconnected fashion, ie add, remove, update rows as you like without roundabouts to the database. You later use the Update method of the DataAdapter to push all you updates made to the Dataset through.
There's alot more to this of course, but hopefully I got you on track...
is it the same way i'd connect to a SQL Server Db ??
caus im usin ado @ the mo but my boss wanted me to check out MDB's ?? god knows why SQL server's much better
There is a SQLConnection object a SQLDataAdapter and so on.... and they are much the same.
So if you use that its just to change into OleDb version of all objects and change the connectionstring to a JET one.
If that is the case I personally think SQL is better in most cases, but if you are using old ADO through com, I can only suggest that you change to either, as the difference between old ADO and ADO.NET is a lot greater that the difference between ADO.NET's SQL and OleDb variants.
This might prove helpful. ConnectionStrings.com
many thanks think i've got it sorted :)