using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;//1
using System.Data.SqlClient;//2


public partial class drnewreg : System.Web.UI.Page
{
    SqlDataAdapter adp = new SqlDataAdapter("select * from drregnew", @"Data Source=.\SQLEXPRESS;AttachDbFilename=F:\website\doctor\App_Data\drreg.mdf;Integrated Security=True;User Instance=True");//3
    DataTable dt = new DataTable();//4

    protected void Page_Load(object sender, EventArgs e)
    {
        adp.Fill(dt);//5
        SqlCommandBuilder str = new SqlCommandBuilder(adp);//6
    }
    protected void btnNewreg_Click(object sender, EventArgs e)
    {
        DataRow dr = dt.NewRow();
        dr["CHAMBER_NO"] = ddlChamberno.Text;
        dr["DOCTOR_NAME"] = txtDoctorname.Text;
        dr["DOCTOR_ID"] = txtDoctorid.Text;
        dr["DOCTOR_DESCRIPTION"] = txtDescription.Text;
        dr["DOCTOR_TYPE"] = ddlType.Text;
        dr["DOCTOR_SHIFT"] = ddlShift.Text;
        dr["DOCTOR_OFFDAY"] = ddlOffday.Text;
        dr["DOCTOR_ADDRESS"] = txtAddress.Text;
        dr["DOCTOR_FEES"] = txtFees.Text;
        dr["LOCATION"] = ddlLocation.Text;
        dr["MOB_NO"] = txtMobileno.Text;
        dr["DOB"] = txtDob.Text;
        dr["PASSWORD"] = txtPassword.Text;
        dt.Rows.Add(dr);//8
        adp.Update(dt);//9

    }
    protected void txtPassword_TextChanged(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        Response.Redirect("home.aspx");
    }
}