Friday, March 30, 2012

Is there a sql database function to check connection string?

Im working on a db library and I have everything working, what Im wanting to do is though is add a method that can check a connection string to make sure it is actually working. Right now, I have it doing a simple select * query to a particular table and returning true or false if an exception is caused. But I want to make the library as generic as possible, so is there another way to test teh connection string and tell if its working or not?
Thanks,
CedricHmm. Well you could try something like SELECT GETDATE() or SELECT @.@.VERSION, which are not database schema-specific.

No comments:

Post a Comment