simple webservice not working "Login failed for us

mavimax34

New Member
I am using a simple XML web service which fetches data from a single table. When it tries to fetch data from sql server 2000 it fails and shows an erros as "Login failed for user 'VAIO/ASPNET'.<BR><BR>I added ASPNET user with Administrator priviliges to SQL server database. but still same problem.<BR><BR>can anyone suggest a solution please..<BR><BR>thank you<BR>nathAre you defining a uid and pwd in your sql connection string? It sounds like you aren't and therefore the user id that the webservice is running under is being asumed. IIS will automatically inject the iusr_machine name account unless you define it.omn,<BR>You raised a good point about security.<BR><BR>I used a sqladapter control on my webservice form. when I droped the adapter control, the wizard kicks in and took me with a series of questions and finally in 'sqlconnection' property it showed "data source=VAIOBNATH;initial catalog=Northwind;integrated security=SSPI;persist security info=False;workstation id=VAIO;packet size=4096".<BR><BR>There is no where I mentioned uid and pwd. <BR>I used sqladapter controls in VB.NEt in my practice projects and I didn't mention about the sql server uid and pwd anywhere. Your reply raised new questions to me.<BR><BR>can you share your thoughts further please??<BR>thx in advance<BR>basamBasam,<BR><BR>I don't use very many of the wizards in vs.net. I have found them to be to heavy and often included unnecessary code. Here's a quick SQL connection I often use:<BR><BR> Dim conn As New SqlConnection(server=mydbservername;uid=sa;pwd=myp assword;database=mydb;Connection Lifetime=10;Enlist=true;pooling=true;Max Pool Size=100")<BR> Dim com As SqlCommand<BR> Dim sql As String<BR> Dim chat_id As String = Request("chat_id")<BR> sql = "DELETE FROM chat_main WHERE id = " & chat_id<BR> conn.Open()<BR> com = New SqlCommand(sql, conn)<BR> com.ExecuteNonQuery()<BR> sql = "DELETE FROM chat_table WHERE chat_id = " & chat_id<BR> com = New SqlCommand(sql, conn)<BR> com.ExecuteNonQuery()<BR> conn.Close()<BR> conn.Dispose()<BR> com.Dispose()<BR><BR>This statement will insert into a table. You mentioned that you were using a SQLAdaptor? Are you trying to insert, update, delete or select? If you are inserting, updating or deleting I have found that using the SQLClient with only a SQLCommand works well. If you are selecting I only use the SQLReader. It's a fire hose type of forward only data. You can't move forward and backward in the data, but for forward only stuff it's the only way to go and get good performance.<BR><BR>hth.<BR>
 
Top