hi i am creating the new website in visual 2010 with sql 2008..but i am facing some problem. i applied a button on a webpage with the insert querey into table the querey is "insert into ddd values(abc,cbd)" but when i entered the button it shows the errors.. invalid column name 'abc' invalid column name 'cbd' but it is only the entry into table. it is not the column name.. so tell me where is the problem
What is the structure of the table ddd? It is generally better to be explicit in your SQL anyway incase the table structure changes in the future INSERT INTO table_name (column1, column2, column3,...) VALUES (value1, value2, value3,...) Code (markup):
You are therefore trying to insert abc into an integer field and you are missing ' ' around the text to show it is text
is not advisable to use "name", "data" as they are reserverd keywords I always use txtName, txtData that way you can have no problems hope this helps
"insert into ddd values(abc,cbd)" Here you forgot to give single quote (') because charecter should write in single quote that is "insert into ddd values('abc','cbd')"