Hi..
I have a web application(ASP.NET 2.0 + C#). I have sql server 2000 as well as sql server 2005.
Several queries in my application work well with the sql server 2005, and the same query fails in the sql server 2000.
How to check if the database is connected to sql server 2000 or sql server 2005 and then call the queries accordingly through the c# code?
Thanks
That may be happening if you are using built-in stored procedures or the INFORMATION_SCHEMA from 2005. There's stuff in 2005 that doesn't exist in 2000.
You are the one establishing the connection, right? You have to know which one you are connecting to when you do, right? You'll have to have a connection to your 2005 instance and one to your 2000 instance. Although for performance purposes, I'd recommend migrating your db to 2005.
Of course, you can always look at the Database property of your connection object if you are getting it from somewhere deep in the bowels of legacy code.
No comments:
Post a Comment