F
Frank Schumacher
Hi NG,
I try to connect to a remote MS-SQL-Server 2000 from an ASP.NET
application. Here's how I do it:
private void ConnectToDatabase(string host, string dataBaseName, string
userID, string password)
{
string connectionString;
connectionString = "Initial Catalog=" + dataBaseName + ";";
connectionString += "Data Source=" + host + ";";
connectionString += "Integrated Security=SSPI;";
connectionString += "User ID=" + userID + ";";
connectionString += "Password=" + password + ";";
_myConnection = new SqlConnection();
_myConnection.ConnectionString = connectionString;
try
{
_myConnection.Open();
}
catch (Exception e)
{
throw e;
}
}
If I use this module in a windows-gui c# project, it works fine. But in
an ASP.NET application I get the error: Login failed for user
'domainname\computername$'
I have double checked User ID and Password in the connetion string, but
they were correct.
Any ideas on that?
Thanks,
Frank
I try to connect to a remote MS-SQL-Server 2000 from an ASP.NET
application. Here's how I do it:
private void ConnectToDatabase(string host, string dataBaseName, string
userID, string password)
{
string connectionString;
connectionString = "Initial Catalog=" + dataBaseName + ";";
connectionString += "Data Source=" + host + ";";
connectionString += "Integrated Security=SSPI;";
connectionString += "User ID=" + userID + ";";
connectionString += "Password=" + password + ";";
_myConnection = new SqlConnection();
_myConnection.ConnectionString = connectionString;
try
{
_myConnection.Open();
}
catch (Exception e)
{
throw e;
}
}
If I use this module in a windows-gui c# project, it works fine. But in
an ASP.NET application I get the error: Login failed for user
'domainname\computername$'
I have double checked User ID and Password in the connetion string, but
they were correct.
Any ideas on that?
Thanks,
Frank