i have a large amount of code to convert (over 100 asp ver. 2 pages)
Microsoft Access to SQL SERVER EXPRESS
the original code uses the OleDbDataAdapter
example: =========
Dim Connect As OleDbConnection = New OleDbConnection
Dim MyAdapter As OleDbDataAdapter = New OleDbDataAdapter
Dim MyCmdbuilder As OleDbCommandBuilder
Dim Mydataset As DataSet = New DataSet
Dim SelectStatement as string = "select * from tbl_weblog"
Dim connectString as string = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=e:\web\users\data\abc.mdb"
Connect.ConnectionString = ConnectString
MyAdapter.SelectCommand = new OleDbCommand(SelectStatement, Connect)
MyCmdbuilder = New OleDbCommandBuilder(MyAdapter)
MyAdapter.Fill(Mydataset,"tbl_weblog")
================
Can i just change the connection string to point to the new database, assuming the field names and structures are all the same.
Yes, you can, but it's not optimal. The native SqlClient is much better. You could just replace every occurance (search & replace in VS) of "OleDb" with "Sql", and take it from there.
Thanks for the reply
Are there big differences between the Oledb and SQL Client?
You say "much better", in what areas?
reliabilty, scalability or performance?
Does anyone know where i could research this further?
|||
Sorry for being too brief...
The performance difference can be huge in some occasions, and you get nice features such as named parameters.
No comments:
Post a Comment