string s="Davolio";
SqlConnection thisConnection=new SqlConnection
("Data Source=(local);Initial Catalog=Northwind;UID=sa;PWD=");
thisConnection.Open ();
SqlCommand thisCommand=thisConnection.CreateCommand ();
thisCommand.CommandText =
" select * from employees where LastName=@charname";
thisCommand.Parameters.Add("@charname",s);