M
Mark Allison
Hi,
VERY simple problem!
if (regServer.UseTrustedConnection == 1)
{
string connectionString = "server=" + regServer.Name + ";
Trusted_Connection=yes; database=master";
}
else
{
string connectionString = "server= " + regServer.Name +
";uid="+regServer.Login+";password="+regServer.Password+";database=master";
}
Console.WriteLine (connectionString);
I get an error on the last line saying:
The name 'connectionString' does not exist in the class or namespace.
Why is that? I just declared it in my if statement.
Thanks.
--
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602m.html
VERY simple problem!
if (regServer.UseTrustedConnection == 1)
{
string connectionString = "server=" + regServer.Name + ";
Trusted_Connection=yes; database=master";
}
else
{
string connectionString = "server= " + regServer.Name +
";uid="+regServer.Login+";password="+regServer.Password+";database=master";
}
Console.WriteLine (connectionString);
I get an error on the last line saying:
The name 'connectionString' does not exist in the class or namespace.
Why is that? I just declared it in my if statement.
Thanks.
--
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602m.html