[WebMethod]
public String AuthenticateUser(String username, String password)
{
con.ConnectionString = ConfigurationManager.ConnectionStrings["cn"].ConnectionString;
if (con.State == ConnectionState.Closed)
{
con.Open();
}
if (username.Equals("admin") && password.Equals("pass"))
{
adp = new SqlDataAdapter(@"select Username,UserType,MembershipID from Membership where MembershipID='4'", con);
dt = new DataTable();
adp.Fill(dt);
if (dt.Rows.Count > 0)
{
return dt.ToString();
}
else { }
}
return dt.ToString();
}
Sir this is my code in the Webservice page, i want to return select query results as a string through this webservice.
Please give suggestions on the above code where i need to make changes.
Also how will i write the code on the page where i am reading the returned value from this webservice?
Thanks