//this is the stored procedure:
ALTER PROCEDURE [dbo].[LogInProcedure]
@username nvarchar (50),
@password nvarchar (50),
@groupnum nvarchar (50)
AS
SET NOCOUNT ON;
SELECT * FROM users
WHERE user_username=@username AND user_password=@password
//this is the code for retrieving info from it:
public bool doLogIn(string username, string password)
{
con.Open();
SqlCommand cmd = new SqlCommand("LogInProcedure", con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@username", username);
cmd.Parameters.AddWithValue("@password", password);
SqlDataReader read = cmd.ExecuteReader();
if (read.HasRows)
return true;
else
return false;
}