mattiesunglow
New Member
I want to return a particular record from the webservice. Still what i have successfully done is, got all the records by the following code:\[code\] SqlConnection con; SqlDataAdapter adap; DataSet ds; [WebMethod] public DataSet Getmember() { con = new SqlConnection(@"Data Source=SQLDOTNET\MSSQLSERVER2008;Initial Catalog=doctor;Persist Security Info=True;User ID=sa;pwd=test123#;"); adap = new SqlDataAdapter("select * from tblusers", con); ds = new DataSet(); adap.Fill(ds, "tblusers"); return ds; }\[/code\]Now i want to get a particular record by Emailid for that i have tried the following code:\[code\]SqlConnection con; SqlDataAdapter adap; DataSet ds; [WebMethod] public DataSet Getmember(String Emailid) { Emailid = "[email protected]"; con = new SqlConnection(@"Data Source=SQLDOTNET\MSSQLSERVER2008;Initial Catalog=doctor;Persist Security Info=True;User ID=sa;pwd=test123#;"); adap = new SqlDataAdapter("select * from tblusers where EmailAddress=" + Emailid, con); ds = new DataSet(); adap.Fill(ds, "tblusers"); return ds; }\[/code\]But this code throwing the following error:\[code\]System.Data.SqlClient.SqlException: Invalid column name '[email protected]'.\[/code\]Please help me..