Monday, October 4, 2010

Pass Storeprocedure how

#region btnSubmit_Click

protected void btnSubmit_Click(object sender, EventArgs e)
{
string userName = txtUserName.Text.Trim();
string password = txtPassword.Text.Trim();

string storeProcedure = "SP_FETCH_USER_DATA";
DataTable resultDatatable = userEntity.fetchUserData(userName,password,storeProcedure);
if(resultDatatable!=null && resultDatatable.Rows.Count>0)
{
Response.Redirect("~/WelCome.aspx");
}

else
private void BindGrid()
{
string procedureName = "SP_FETCH_ALL_USERDATA";
DataTable resultDatatable = userEntity.FetchAllUserData(procedureName);
if (resultDatatable != null && resultDatatable.Rows.Count > 0)
{
GridViewUser.DataSource = resultDatatable;
GridViewUser.DataBind();

}

else
{
GridViewUser.DataBind();
}



}
{
Label1.Text = "Invalid Username and Password";
Label1.ForeColor = Color.Red;
}




}

#endregion

No comments:

Post a Comment