SQL command using parameters syntax error -


hi new sql , c# queries. using select statement , puttin @ parameters in using sql.

string cmd = "select (firstname, lastname, address, city, postalcode, country, username) values (@firstname, @lastname, @address, @city, @postalcode, @country, @username) [customer];"; 

it doesnt sql can tell me why? says incorrect syntax can not spot where?

thanks dom

the select statement used select data database.

if want retrieve data don' t have add values keyword:

select column_name,column_name table_name; 

with query:

string cmd = "select firstname, lastname, address, city, postalcode,                country, username customer;"; 

in case wanted retrieve data parameters syntax:

select column_name,column_name table_name column_name operator value; 

with query:

string cmd = "select firstname, lastname, address, city, postalcode,                country, username customer firstname=@firstname ,               lastname=@lastname , address=@address , city=@city ,               postalcode=@postalcode , country=@country , username=@username;"; 

altough not correct because can check id set on customer table.

string cmd = "select firstname, lastname, address, city, postalcode,                    country, username customer *yourid*=*@yourid*;"; 

you can have try here:

http://www.w3schools.com/sql/sql_select.asp

http://www.w3schools.com/sql/sql_where.asp


Comments

Popular posts from this blog

css - SVG using textPath a symbol not rendering in Firefox -

Java 8 + Maven Javadoc plugin: Error fetching URL -

order - Notification for user in user account opencart -