Exemplo n.º 1
0
        private void button3_Click(object sender, EventArgs e)
        {
            NorthwindDataset.EndInit();
            var index = dataGridView1.CurrentRow.Index;

            NorthwindDataset.Tables["Customers"].Rows[index].Delete();

            SqlDataAdapter1.Update(NorthwindDataset.Tables["Customers"]);
        }
Exemplo n.º 2
0
        private void button2_Click(object sender, EventArgs e)
        {
            DataRow CustRow = NorthwindDataset.Tables["Customers"].NewRow();

            Object[] CustRecord = { "AAAAA",                "Alfreds Futterkiste", "Maria Anders",
                                    "Sales Representative", "Obere Str. 57",       "Berlin",
                                    null,                   "12209",               "Germany",     "030-0074321", "030-0076545" };
            CustRow.ItemArray = CustRecord;
            NorthwindDataset.Tables["Customers"].Rows.Add(CustRow);

            SqlDataAdapter1.Update(NorthwindDataset.Tables["Customers"]);
        }
Exemplo n.º 3
0
 private void button1_Click(object sender, EventArgs e)
 {
     NorthwindDataset.EndInit();
     SqlDataAdapter1.Update(NorthwindDataset.Tables["Customers"]);
 }
Exemplo n.º 4
0
 private void Form1_Load(object sender, EventArgs e)
 {
     SqlDataAdapter1.Fill(NorthwindDataset, "Customers");
     dataGridView1.DataSource = NorthwindDataset.Tables["Customers"];
 }