SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Please Help me somebody
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Jhonz Khan
Starting Member

Pakistan
2 Posts

Posted - 07/04/2013 :  06:11:26  Show Profile  Reply with Quote
i have got the following error while inserting data into a table:
-----------------------------------
The name "Farhad" is not permitted in this context. Valid expressions are constants, constant expressions, and (in some contexts) variables. Column names are not permitted.
-----------------------------------
while for this insertion i have used the following Query

-----------------------------------
Dim Pqury4 As String = " INSERT INTO tbl_TempAppointmen (SNo,pID,docID,appID,Name_ptnt,DocName,Disease) VALUES ('" & SerialNo & "','" & MaxPID & "'," & cmbDocName.SelectedValue & ",'" & MaxAppID & "', " & PatntMane & "," & cmbDocName.Text & "," & deases & ")"
-----------------------------------

Jhonz

visakh16
Very Important crosS Applying yaK Herder

India
52317 Posts

Posted - 07/04/2013 :  07:18:44  Show Profile  Reply with Quote

Dim Pqury4 As String = " INSERT INTO tbl_TempAppointmen (SNo,pID,docID,appID,Name_ptnt,DocName,Disease) VALUES ('" & SerialNo & "','" & MaxPID & "','" & cmbDocName.SelectedValue & "','" & MaxAppID & "', '" & PatntMane & "','" & cmbDocName.Text & "','" & deases & "')"


------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

Jhonz Khan
Starting Member

Pakistan
2 Posts

Posted - 07/05/2013 :  07:56:53  Show Profile  Reply with Quote
Dear visakh16!
i got your given links but it is out of the range of my question if you have an actual answer for my question then please help me?????

Jhonz

Edited by - Jhonz Khan on 07/05/2013 07:58:46
Go to Top of Page

James K
Flowing Fount of Yak Knowledge

3638 Posts

Posted - 07/05/2013 :  08:51:39  Show Profile  Reply with Quote
Ignore the links - that is just his signature line. What he posted IS an actual answer. Copy his code and use that to replace the statement in your code and run it.

Edited by - James K on 07/05/2013 08:52:08
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52317 Posts

Posted - 07/07/2013 :  10:05:43  Show Profile  Reply with Quote
quote:
Originally posted by Jhonz Khan

Dear visakh16!
i got your given links but it is out of the range of my question if you have an actual answer for my question then please help me?????

Jhonz



Did you try the query at all?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000