Exemplo n.º 1
0
        private void addtrip_Click(object sender, EventArgs e)
        {
            con.Open();

            SqlCommand cmd = new SqlCommand("insert into suppliergrid1(SID,Name,Phone,City,PostalCode,Country,Street) values('" + sid.Text + "','" + sname.Text + "','" + sphone.Text + "','" + scity.Text + "','" + spcode.Text + "','" + scountry.Text + "','" + conname.Text + "')", con);

            cmd.ExecuteNonQuery();

            MessageBox.Show("data inserted");

            sid.Clear();
            sname.Clear();
            sphone.Clear();
            scity.Clear();
            spcode.Clear();
            scountry.Clear();
            conname.Clear();

            sid.Text = Autogenerate.autogen("suppliergrid1", "SID");

            con.Close();


            showtrip.Enabled = false;
        }
Exemplo n.º 2
0
        private void Suppliers_Load(object sender, EventArgs e)
        {
            addtrip.Enabled = true;

            showtrip.Enabled = true;

            sid.Text = Autogenerate.autogen("suppliergrid1", "SID");
        }