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:
Comments
Post a Comment