| Author |
Message |
aperregatturv
Joined: 31 Aug 2005 Posts: 48 Location: New York
|
Posted: Tue Aug 05, 2008 2:44 pm Post subject: GetDatabases missing |
|
|
Hi
Currently, I am using SQL Tool kit 6 which has the following code.
RedGate.SQL.Shared.SQLServer.GetDatabases(s, false, UID, PWD, true);
to retrieve all the databases.
Now, I am looking for this code in SDK 7 and unable to find.
Please let me know where i can find this.
Thanks |
|
| Back to top |
|
 |
Brian Donahue
Joined: 23 Aug 2004 Posts: 6344 Location: Red Gate Software
|
Posted: Tue Aug 05, 2008 3:58 pm Post subject: |
|
|
Hi,
I'm not sure that the SQLServer class is meant to be public, but I can tell you that it has moved to the RedGate.Shared.SQL.Server namespace. Quite a lot of RedGate.SQL.Shared has been shuffled around into different namespaces, so the next time you run into this problem, you may want to use Visual Studio's Object Explorer to search for the particular class you're looking for and find out where it's moved to. _________________ Brian Donahue
Technical Support
Red Gate Software Ltd.
44 (0)870 160 0037 ext 8521
US and CAN 1-866-RED GATE ext 8521 |
|
| Back to top |
|
 |
aperregatturv
Joined: 31 Aug 2005 Posts: 48 Location: New York
|
Posted: Tue Aug 05, 2008 4:06 pm Post subject: |
|
|
Brian,
Thanks for the reply. I already checked all the assemblies in the object Explorer before posting this.
This is what i see in SDK 7
RedGate.Shared.SQL.Server
SQLServerDiscoveryExecption
Base Types
Exception
ISerializable.
Please check again. I use that code in lot of places where database list is populated and I don't want to rewrite all over again. I hope you understand the difficulties what we face.
Thanks
Arun |
|
| Back to top |
|
 |
Brian Donahue
Joined: 23 Aug 2004 Posts: 6344 Location: Red Gate Software
|
Posted: Tue Aug 05, 2008 4:14 pm Post subject: |
|
|
Hi Arun,
Ah I see. I don't think the GetDatabases method is static as in your example. I've got...
| Code: |
try
{
if (checkBox1.Checked)
sqlServer = new SQLServer(true, comboBox2.Text, null, null);
else
{
// If SqlServer instance can't be initialized
// try, try again with SQL authentication
SqlAuthentication a = new SqlAuthentication(comboBox2.Text);
a.PasswordUpdate += new PasswordEventHandler(a_PasswordUpdate);
a.ShowDialog();
}
}
catch (Exception)
{
// Could not Connect -- try SQL auth
SqlAuthentication a = new SqlAuthentication(comboBox2.Text);
a.PasswordUpdate += new PasswordEventHandler(a_PasswordUpdate);
a.ShowDialog();
}
try
{
comboBox1.DataSource = sqlServer.GetDatabases(true);
}
catch (System.Data.SqlClient.SqlException){} |
_________________ Brian Donahue
Technical Support
Red Gate Software Ltd.
44 (0)870 160 0037 ext 8521
US and CAN 1-866-RED GATE ext 8521 |
|
| Back to top |
|
 |
|
|
All times are GMT + 1 Hour
|
| Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group