Jump to content
Xtreme .Net Talk

How the INSERT statement executed correctlly in ASP .net With VC#


Recommended Posts

Posted (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

 

Thankx

sourcecode.cs

Edited by The History
Posted

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)

Posted
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.

Asif Raza Ashraf

Senior Software Engineer

Electronic Solutions Pakistan

Islamabad

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...