Consuming Web Service error

Mar 24 2006 10:38 AM
Hello, I have created an ASP.NET Web Service which handles data from a SQL Server 2005 database. When debuging the web service from the web site project everything works ok: I can invoke all the methods without any problems. I have deployed the web service in IIS using on virtual directory, created a C# project, added the web reference successfully, but when calling the web service I get the following error: System.Web.Services.Protocols.SoapException was unhandled Message="System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Data.SqlClient.SqlException: Cannot open database \"MedMax\" requested by the login. The login failed.\nLogin failed for user 'ANDREIC-PC\\ASPNET'.\n at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)\n at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)\n at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)\n at System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK)\n at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance)\n at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)\n at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection)\n at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options)\n at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject)\n at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject)\n at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)\n at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)\n at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)\n at System.Data.SqlClient.SqlConnection.Open()\n at Service.GetUsers(Int32 type) in e:\\my project\\SQL - WebService1\\App_Code\\MedMaxWS.cs:line 281\n --- End of inner exception stack trace ---" The connection string I use in the web service is the following: const string connStr = "Server=ANDREIC-PC\\SQLEXPRESS;Database=MedMax;Trusted_Connection=True"; and I have also tryed: const string connStr = "Data Source=ANDREIC-PC\\SQLEXPRESS;Initial Catalog=MedMax;Integrated Security=True"; I don't understand why in the error the specified user is : ANDREIC-PC\\ASPNET ...:-( I have worked with web services, but this is the first time I create a web service that works with a database. Can someone help me with this problem? Thanks in advance! AndreiC