using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Data.OleDb; public partial class askforpassword : System.Web.UI.Page { OleDbConnection conn; connection objconn = new connection(); protected void Page_Load(object sender, EventArgs e) { conn = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\Domains\nid.edu\db\database.mdb;Persist Security Info=True"); // conn=objconn.getconn(); } protected void btnSubmit_Click(object sender, EventArgs e) { try { string strFlag; strFlag = "no"; OleDbCommand cmd1 = new OleDbCommand("select * from membermaster where email='"+ txtUserEmail.Text +"'",conn); OleDbDataAdapter dap = new OleDbDataAdapter(cmd1); DataTable dt = new DataTable(); int count=dap.Fill(dt); if (count == 0) { OleDbCommand cmd = new OleDbCommand("insert into MemberMaster (YR_SPLSN,NameOnCertificate,Discipline,EMAIL,Flag_UserId,flagapprove) values('" + txtYearGraduation.Text + "','" + txtCertificate.Text + "','" + txtDiscipline.Text + "','" + txtUserEmail.Text + "','" + strFlag + "','" + 0 + "')", conn); conn.Open(); cmd.ExecuteNonQuery(); conn.Close(); lblError.Visible = true; lblError.Text = "Thank you for registration.Your Userid and password will be send on you mail Id withing two working day."; txtCertificate.Text = ""; txtDiscipline.Text = ""; txtUserEmail.Text = ""; txtYearGraduation.Text = ""; } else { lblError.Visible = true; lblError.Text = "already Registered"; } } catch (Exception ex) { lblError.Visible = true; lblError.Text = ex.Message; } } }