I need to switch between some databases at the same time (using VB.net). As far as I know, I must create some connection Strings and use them in different conditions.
For example
If ( condition ) then
use connection String 1
elseif (condition) then
use connection String 2
end if
Can anyone help me how to handle this?
I’m using MSSQL 2005 and VB.net
In VB.NET, you need to add a module and write few functions there. And use these function to establish and close connection to Database.
Variables:
ConnectionString variables (both)
Functions:
conditions in If Else Structure. Like:
Code:
Use this “Create_Database_Connection(condition_param)” Method where you need to establish connection in code depending upon you conditional parameters.