How to connect ASP.Net With SQL Server
-
I am new of ASP.Net and facing a problem that whenever I do connection ASP.Net with Sql Server it gives me error "Login failed for user 'ComputerName\ASPNET'. Exception Details: System.Data.SqlClient.SqlException: Login failed for user 'ComputerName\ASPNET'. Line 78: thisAdapter.Fill(thisDataSet,"Customers"); I am doing like this " string myConnectionString = "Initial Catalog=Northwind;Data Source=localhost;Integrated Security=SSPI;server=ComputerName\\MY2000"; thisConnection = new SqlConnection(myConnectionString); and so on. It is working fine in windows form. Thanks
-
I am new of ASP.Net and facing a problem that whenever I do connection ASP.Net with Sql Server it gives me error "Login failed for user 'ComputerName\ASPNET'. Exception Details: System.Data.SqlClient.SqlException: Login failed for user 'ComputerName\ASPNET'. Line 78: thisAdapter.Fill(thisDataSet,"Customers"); I am doing like this " string myConnectionString = "Initial Catalog=Northwind;Data Source=localhost;Integrated Security=SSPI;server=ComputerName\\MY2000"; thisConnection = new SqlConnection(myConnectionString); and so on. It is working fine in windows form. Thanks
When you're using ASP.NET, you're working as the ASPNET user. That user needs to have the right to log in to SQL Server. The easiest way around is to log in with username/password instead of using Windows authentication. Christian Graus - Microsoft MVP - C++
-
When you're using ASP.NET, you're working as the ASPNET user. That user needs to have the right to log in to SQL Server. The easiest way around is to log in with username/password instead of using Windows authentication. Christian Graus - Microsoft MVP - C++
Thanks for your mail. I am doing like this string myConnectionString = "Initial Catalog=MyDB;Data Source=localhost;Integrated Security=SSPI;server=ComputerName\\MY2000;user id=sa; Password="; My password is blank. I am not using windows authentication. It is working without using ASP.NET.
-
Thanks for your mail. I am doing like this string myConnectionString = "Initial Catalog=MyDB;Data Source=localhost;Integrated Security=SSPI;server=ComputerName\\MY2000;user id=sa; Password="; My password is blank. I am not using windows authentication. It is working without using ASP.NET.