Exemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            con = new SqlConnection("Data Source=162.222.225.88;Initial Catalog=rcipune2017;user Id=rcinfotech;password=Rci@1234");
            con.Open();
            String         cmd1 = "select cl_id,cl_name from rc_master";
            SqlDataAdapter adpt = new SqlDataAdapter(cmd1, con);
            DataTable      dt   = new DataTable();
            adpt.Fill(dt);
            Drop_NamePers.DataSource = dt;
            Drop_NamePers.DataBind();
            Drop_NamePers.DataTextField = "cl_name";
            //Drop_NamePers.DataValueField = "ID";
            Drop_NamePers.DataBind();

            //DropDownList1.DataSource = cmd.ExecuteReader();
            //DropDownList1.DataTextField = "cl_name";
            //DropDownList1.DataBind();
            //con.Close();
            txtDate.Text = DateTime.Now.Date.ToShortDateString();
            txtTime.Text = DateTime.Now.ToString("hh:mm:ss tt");
            Drop_NamePers.Items.Add(new ListItem("Select"));
            Drop_NamePers.SelectedIndex = Drop_NamePers.Items.IndexOf(Drop_NamePers.Items.FindByValue("Select"));
        }
    }
Exemplo n.º 2
0
    protected void Tab3_Click(object sender, EventArgs e)
    {
        Tab1.CssClass            = "Initial";
        Tab2.CssClass            = "Initial";
        Tab3.CssClass            = "Clicked";
        MainView.ActiveViewIndex = 2;
        txtClientId.Text         = "";
        txtCl_Name.Text          = "";
        txtAddress.Text          = "";
        txtCont_Person.Text      = "";
        SqlCommand cmdp;

        con  = new SqlConnection("Data Source=162.222.225.88;Initial Catalog=rcipune2017;user Id=rcinfotech;password=Rci@1234");
        cmdp = new SqlCommand("select cl_name from rc_master", con);
        con.Open();
        Drop_NamePers.DataSource    = cmdp.ExecuteReader();
        Drop_NamePers.DataTextField = "cl_name";
        Drop_NamePers.DataBind();
        con.Close();
    }