M
musosdev
Hi gang,
I've just opened one of my web projects (C#, .net 2.0) in VS2008 and ran the
conversion wizard.
Everything went ok, but the site won't work. My ConnectionString on all my
database connections is wrong.
I've just had a look, and notice that the Access MDB file the website used
seems to have been replaced/upgraded with an MDF file. Is this expected
behaviour?!
Unfortunately, it hasn't upgraded all my OLEDB connections.
Here's an example...
----------------------
// open the db
OleDbConnection dbConn = new
OleDbConnection(ConfigurationSettings.AppSettings.Get("System_ConnectionString"));
dbConn.Open();
OleDbCommand genreCmd = new OleDbCommand("SELECT genre_id, genre_name
FROM genres WHERE relates_to = 0 ORDER BY genre_name ASC", dbConn);
OleDbDataReader genreDR = genreCmd.ExecuteReader();
----------------
I've changed the connection string to see if it would accept the MDF file
(unlikely I know). It gave me the "unrecognised database format" error.
So the question is.... can I get the OLEDB commands to talk to the mdf
file!? If so, how? And if not, is there a quick way to change all my db
connection code to SQLConnections?!
Thanks,
Dan
I've just opened one of my web projects (C#, .net 2.0) in VS2008 and ran the
conversion wizard.
Everything went ok, but the site won't work. My ConnectionString on all my
database connections is wrong.
I've just had a look, and notice that the Access MDB file the website used
seems to have been replaced/upgraded with an MDF file. Is this expected
behaviour?!
Unfortunately, it hasn't upgraded all my OLEDB connections.
Here's an example...
----------------------
// open the db
OleDbConnection dbConn = new
OleDbConnection(ConfigurationSettings.AppSettings.Get("System_ConnectionString"));
dbConn.Open();
OleDbCommand genreCmd = new OleDbCommand("SELECT genre_id, genre_name
FROM genres WHERE relates_to = 0 ORDER BY genre_name ASC", dbConn);
OleDbDataReader genreDR = genreCmd.ExecuteReader();
----------------
I've changed the connection string to see if it would accept the MDF file
(unlikely I know). It gave me the "unrecognised database format" error.
So the question is.... can I get the OLEDB commands to talk to the mdf
file!? If so, how? And if not, is there a quick way to change all my db
connection code to SQLConnections?!
Thanks,
Dan