473,386 Members | 1,962 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

hi..I use sqlserver2005 as backend in my C# application i write following query

"insert into stud_Exam_Record(PRN,Roll_no,First_name,Last_Name, UN1_Total,UN2_Total,Final_total,Final_Outof,Percen tage)values('" + textBox1.Text + "','" + textBox2.Text + "'," + textBox3.Text + "," + textBox4.Text + ",'" + textBox5.Text + "','" + textBox6.Text + "','" + textBox7.Text + "','" + textBox8.Text + "','" + textBox9.Text + "') ";
but i face error "The name "fsdgf" is not permitted in this context. Valid expressions are constants, constant expressions, and (in some contexts) variables. Column names are not permitted." data type of First_name is ntext ,please help me
Jan 10 '12 #1
1 1348
Rabbit
12,516 Expert Mod 8TB
You need to enclose all text fields in single quotes. For some reason, you do it for all your fields except first and last name. So it's obvious you know you have to do so, but you probably just missed those two.
Jan 10 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Vinay Jain | last post by:
Hi I want to write soundex query for example: select * from student where name soundex 'vinay'; In psql it gives error at soundex. Regards Vinay -- Vinay Jain Dissertation Project Trainee...
2
by: Eckhart | last post by:
Dear All, Plz help me in optimising the following query, Reduce repeatable reads from the table via select ,ythe table sare not having referntial integrity constarints ,relations CREATE proc...
0
by: somaskarthic | last post by:
Hi I'm having a table with data as follows ID Start_time End_time Days 1. 06:00:00 10:00:00 { 1 } 2. ...
0
by: abhishekjethwani | last post by:
How to write a query to access tree structure form multi table. I m having five tables from them first table give me a data which act as the parameter for query for the second table and the two...
1
by: avkdsiva | last post by:
I want to write a query on emp database, where the First character of empname should not be a letter. i.e., it can either be a number or special character.
2
by: kshirsagar007 | last post by:
friends, I would like to optimize the following query....as its taking 2 minutes to get the records. select a.CODE "Code", ud.Name "Name", a.SchemeId "SchemeID" from (MASTER sh,...
5
by: manjubhashini19583 | last post by:
Sir, how to write select query and insert query at the same time. I have one database that db having six field. waiting for your reply. thanking you
2
by: shabnam | last post by:
HI, I want to write a query for displaying ads.Ads may be many but all advertisements should not be displayed on the web page.only according to the date that particular ad should appear on the web...
1
by: rajeev14th | last post by:
How can i modify the following query in DB2 (CAST(SUBS_REFILL_COUPONNO_CHANNELID AS INTEGER) (FORMAT '9(16)') (CHAR(16)) ) where SUBS_REFILL_COUPONNO_CHANNELID is the column name of my table...
1
by: anuragvatsa | last post by:
please help me to write a query in which i have to genrate report on basis of given columns from different tables. am using sql server 2005 thx & regards
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.