The History Posted October 13, 2003 Posted October 13, 2003 (edited) This is my first try to insert a new record in an SQL Server database but I'm facing a problem when executing the INSERT statement. I'm executing the command and connecting to the database programatically. The following message appears in the Label I craeted to know why the recordes don't INSERTED in the database. Error Message: Cannot open database requested in login 'Software Support HelpDesk'. Login fails. Login failed for user 'MAZEN_EBTTIKAR\ASPNET' The Server name and the databse are showen in the following link as a picture http://www.geocities.com/mazen97/snapshot.GIF If the problem is from authorization of ASPNET then please tell me how to solve this problem from the SQL Server Manager or from MS Visual Studio .net Also I have attached the source code (SourceCode.cs) with this thread. I have to finish this problem within 2 days plaese help :o Thankxsourcecode.cs Edited October 13, 2003 by The History Quote
Administrators PlausiblyDamp Posted October 13, 2003 Administrators Posted October 13, 2003 You will either need to get the web application to impersonate another user (one who does have permissions in the DB) or give the ASPNET account permissions to theDB. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
The History Posted October 13, 2003 Author Posted October 13, 2003 I granted the user to the database but there is something new happened??!! I granted the access to the database and then I tried to run the apllication then I gat this message: Unclosed quotation mark before the character string ',1542778)'. Line 1: Incorrect syntax near ',1542778)'. What is wrong?? I modified the source code and here is the new one in the attachement. (Code.cs) Quote
AsifCh Posted October 15, 2003 Posted October 15, 2003 Your Query which you are executing does not have proper format. try to re design the query and take care the proper qutation marks, you can test the query before executing by displaying it on a label just before its execution. Quote Asif Raza Ashraf Senior Software Engineer Electronic Solutions Pakistan Islamabad
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.