this is for class.
using Microsoft.ApplicationBlocks.Data;
using Microsoft.ApplicationBlocks.ExceptionManagement;
public string connection()
{
return ConfigurationSettings.AppSettings["connection"];
}
public SqlDataReader GetData(string type, string username, string email, string password, string exp)
{
SqlDataReader sqlReader = SqlHelper.ExecuteReader(connection(), CommandType.StoredProcedure, "exam",
new SqlParameter("@type", type),
new SqlParameter("@username, username"),
new SqlParameter("@email", email),
new SqlParameter("@password", password),
new SqlParameter("@exp", exp));
return sqlReader;
}
this is the most simplest way to do it. Hope this helped.