<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://nfex.ru/index.php?action=history&amp;feed=atom&amp;title=Csharp%2FCSharp_Tutorial%2FADO.Net%2FOleDbCommandBuilder</id>
		<title>Csharp/CSharp Tutorial/ADO.Net/OleDbCommandBuilder - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://nfex.ru/index.php?action=history&amp;feed=atom&amp;title=Csharp%2FCSharp_Tutorial%2FADO.Net%2FOleDbCommandBuilder"/>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/ADO.Net/OleDbCommandBuilder&amp;action=history"/>
		<updated>2026-04-30T05:47:01Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/ADO.Net/OleDbCommandBuilder&amp;diff=6458&amp;oldid=prev</id>
		<title> в 15:31, 26 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/ADO.Net/OleDbCommandBuilder&amp;diff=6458&amp;oldid=prev"/>
				<updated>2010-05-26T15:31:53Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 15:31, 26 мая 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
			</entry>

	<entry>
		<id>http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/ADO.Net/OleDbCommandBuilder&amp;diff=6459&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/ADO.Net/OleDbCommandBuilder&amp;diff=6459&amp;oldid=prev"/>
				<updated>2010-05-26T12:19:08Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Delete data and reload to DataGrid==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using System;&lt;br /&gt;
using System.Drawing;&lt;br /&gt;
using System.Collections;&lt;br /&gt;
using System.ruponentModel;&lt;br /&gt;
using System.Windows.Forms;&lt;br /&gt;
using System.Data;&lt;br /&gt;
using System.Data.OleDb;&lt;br /&gt;
using System.Data.SqlClient;&lt;br /&gt;
public class DeleteDataLoadDataGrid : System.Windows.Forms.Form&lt;br /&gt;
{&lt;br /&gt;
  private System.Windows.Forms.DataGrid dataGrid1;&lt;br /&gt;
  private System.Windows.Forms.Button InsertCommand;&lt;br /&gt;
  private System.Windows.Forms.Button UpdateCommand;&lt;br /&gt;
  private System.Windows.Forms.Button DeleteCommand;&lt;br /&gt;
  private System.Windows.Forms.CheckBox checkBox1;&lt;br /&gt;
  private System.ruponentModel.Container components = null;&lt;br /&gt;
  public DeleteDataLoadDataGrid()&lt;br /&gt;
  {&lt;br /&gt;
    InitializeComponent();&lt;br /&gt;
  }&lt;br /&gt;
  protected override void Dispose( bool disposing )&lt;br /&gt;
  {&lt;br /&gt;
    if( disposing )&lt;br /&gt;
    {&lt;br /&gt;
      if (components != null) &lt;br /&gt;
      {&lt;br /&gt;
        components.Dispose();&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    base.Dispose( disposing );&lt;br /&gt;
  }&lt;br /&gt;
  private void InitializeComponent()&lt;br /&gt;
  {&lt;br /&gt;
    this.dataGrid1 = new System.Windows.Forms.DataGrid();&lt;br /&gt;
    this.InsertCommand = new System.Windows.Forms.Button();&lt;br /&gt;
    this.UpdateCommand = new System.Windows.Forms.Button();&lt;br /&gt;
    this.DeleteCommand = new System.Windows.Forms.Button();&lt;br /&gt;
    this.checkBox1 = new System.Windows.Forms.CheckBox();&lt;br /&gt;
    ((System.ruponentModel.ISupportInitialize)(this.dataGrid1)).BeginInit();&lt;br /&gt;
    this.SuspendLayout();&lt;br /&gt;
    // &lt;br /&gt;
    // dataGrid1&lt;br /&gt;
    // &lt;br /&gt;
    this.dataGrid1.DataMember = &amp;quot;&amp;quot;;&lt;br /&gt;
    this.dataGrid1.HeaderForeColor = System.Drawing.SystemColors.ControlText;&lt;br /&gt;
    this.dataGrid1.Location = new System.Drawing.Point(8, 8);&lt;br /&gt;
    this.dataGrid1.Name = &amp;quot;dataGrid1&amp;quot;;&lt;br /&gt;
    this.dataGrid1.Size = new System.Drawing.Size(336, 304);&lt;br /&gt;
    this.dataGrid1.TabIndex = 0;&lt;br /&gt;
    // &lt;br /&gt;
    // InsertCommand&lt;br /&gt;
    // &lt;br /&gt;
    this.InsertCommand.Location = new System.Drawing.Point(368, 24);&lt;br /&gt;
    this.InsertCommand.Name = &amp;quot;InsertCommand&amp;quot;;&lt;br /&gt;
    this.InsertCommand.Size = new System.Drawing.Size(120, 32);&lt;br /&gt;
    this.InsertCommand.TabIndex = 1;&lt;br /&gt;
    this.InsertCommand.Text = &amp;quot;Insert Command&amp;quot;;&lt;br /&gt;
    this.InsertCommand.Click += new System.EventHandler(this.InsertCommand_Click);&lt;br /&gt;
    // &lt;br /&gt;
    // UpdateCommand&lt;br /&gt;
    // &lt;br /&gt;
    this.UpdateCommand.Location = new System.Drawing.Point(368, 72);&lt;br /&gt;
    this.UpdateCommand.Name = &amp;quot;UpdateCommand&amp;quot;;&lt;br /&gt;
    this.UpdateCommand.Size = new System.Drawing.Size(120, 32);&lt;br /&gt;
    this.UpdateCommand.TabIndex = 2;&lt;br /&gt;
    this.UpdateCommand.Text = &amp;quot;Update Command&amp;quot;;&lt;br /&gt;
    this.UpdateCommand.Click += new System.EventHandler(this.UpdateCommand_Click);&lt;br /&gt;
    // &lt;br /&gt;
    // DeleteCommand&lt;br /&gt;
    // &lt;br /&gt;
    this.DeleteCommand.Location = new System.Drawing.Point(368, 120);&lt;br /&gt;
    this.DeleteCommand.Name = &amp;quot;DeleteCommand&amp;quot;;&lt;br /&gt;
    this.DeleteCommand.Size = new System.Drawing.Size(120, 32);&lt;br /&gt;
    this.DeleteCommand.TabIndex = 3;&lt;br /&gt;
    this.DeleteCommand.Text = &amp;quot;Delete Command&amp;quot;;&lt;br /&gt;
    this.DeleteCommand.Click += new System.EventHandler(this.DeleteCommand_Click);&lt;br /&gt;
    // &lt;br /&gt;
    // checkBox1&lt;br /&gt;
    // &lt;br /&gt;
    this.checkBox1.Location = new System.Drawing.Point(368, 192);&lt;br /&gt;
    this.checkBox1.Name = &amp;quot;checkBox1&amp;quot;;&lt;br /&gt;
    this.checkBox1.Size = new System.Drawing.Size(112, 24);&lt;br /&gt;
    this.checkBox1.TabIndex = 4;&lt;br /&gt;
    this.checkBox1.Text = &amp;quot;SqlCommand&amp;quot;;&lt;br /&gt;
    // &lt;br /&gt;
    // DeleteDataLoadDataGrid&lt;br /&gt;
    // &lt;br /&gt;
    this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);&lt;br /&gt;
    this.ClientSize = new System.Drawing.Size(496, 325);&lt;br /&gt;
    this.Controls.AddRange(new System.Windows.Forms.Control[] {&lt;br /&gt;
                                    this.checkBox1,&lt;br /&gt;
                                    this.DeleteCommand,&lt;br /&gt;
                                    this.UpdateCommand,&lt;br /&gt;
                                    this.InsertCommand,&lt;br /&gt;
                                    this.dataGrid1});&lt;br /&gt;
    this.Name = &amp;quot;DeleteDataLoadDataGrid&amp;quot;;&lt;br /&gt;
    this.Text = &amp;quot;DeleteDataLoadDataGrid&amp;quot;;&lt;br /&gt;
    ((System.ruponentModel.ISupportInitialize)(this.dataGrid1)).EndInit();&lt;br /&gt;
    this.ResumeLayout(false);&lt;br /&gt;
  }&lt;br /&gt;
  [STAThread]&lt;br /&gt;
  static void Main() &lt;br /&gt;
  {&lt;br /&gt;
    Application.Run(new DeleteDataLoadDataGrid());&lt;br /&gt;
  }&lt;br /&gt;
  private void InsertCommand_Click(object sender, System.EventArgs e)&lt;br /&gt;
    {&lt;br /&gt;
    }&lt;br /&gt;
  private void UpdateCommand_Click(object sender, System.EventArgs e)&lt;br /&gt;
    {&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
  private void DeleteCommand_Click(object sender, System.EventArgs e)&lt;br /&gt;
    {&lt;br /&gt;
        &lt;br /&gt;
    string ConnectionString = &lt;br /&gt;
      &amp;quot;Provider=Microsoft.Jet.OLEDB.4.0;&amp;quot;+&lt;br /&gt;
      &amp;quot;Data Source=c:\\Northwind.mdb&amp;quot;;&lt;br /&gt;
    OleDbConnection conn = &lt;br /&gt;
      new OleDbConnection(ConnectionString);&lt;br /&gt;
    DataSet ds = new DataSet();&lt;br /&gt;
        &lt;br /&gt;
    try&lt;br /&gt;
    {&lt;br /&gt;
      conn.Open();&lt;br /&gt;
      OleDbDataAdapter adapter = new OleDbDataAdapter(&lt;br /&gt;
        &amp;quot;SELECT * FROM Customers&amp;quot;, conn);&lt;br /&gt;
            &lt;br /&gt;
      OleDbCommandBuilder cmdBuilder = &lt;br /&gt;
        new OleDbCommandBuilder(adapter);&lt;br /&gt;
      adapter.MissingSchemaAction = &lt;br /&gt;
        MissingSchemaAction.AddWithKey;&lt;br /&gt;
    &lt;br /&gt;
      adapter.Fill(ds, &amp;quot;Customers&amp;quot;);&lt;br /&gt;
    &lt;br /&gt;
      DataRow row1 = ds.Tables[&amp;quot;Customers&amp;quot;].Rows.Find(&amp;quot;001&amp;quot;);&lt;br /&gt;
      row1.Delete(); &lt;br /&gt;
      adapter.Update(ds, &amp;quot;Customers&amp;quot;);&lt;br /&gt;
      dataGrid1.DataSource = ds.DefaultViewManager;&lt;br /&gt;
    }&lt;br /&gt;
    catch(OleDbException exp)&lt;br /&gt;
    {&lt;br /&gt;
      MessageBox.Show(exp.Message.ToString());&lt;br /&gt;
    }&lt;br /&gt;
    if(conn.State == ConnectionState.Open)&lt;br /&gt;
      conn.Close();     &lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Insert Data and reload to DataGrid==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using System;&lt;br /&gt;
using System.Drawing;&lt;br /&gt;
using System.Collections;&lt;br /&gt;
using System.ruponentModel;&lt;br /&gt;
using System.Windows.Forms;&lt;br /&gt;
using System.Data;&lt;br /&gt;
using System.Data.OleDb;&lt;br /&gt;
using System.Data.SqlClient;&lt;br /&gt;
public class InsertDataLoadDataGrid : System.Windows.Forms.Form&lt;br /&gt;
{&lt;br /&gt;
  private System.Windows.Forms.DataGrid dataGrid1;&lt;br /&gt;
  private System.Windows.Forms.Button InsertCommand;&lt;br /&gt;
  private System.Windows.Forms.Button UpdateCommand;&lt;br /&gt;
  private System.Windows.Forms.Button DeleteCommand;&lt;br /&gt;
  private System.Windows.Forms.CheckBox checkBox1;&lt;br /&gt;
  private System.ruponentModel.Container components = null;&lt;br /&gt;
  public InsertDataLoadDataGrid()&lt;br /&gt;
  {&lt;br /&gt;
    InitializeComponent();&lt;br /&gt;
  }&lt;br /&gt;
  protected override void Dispose( bool disposing )&lt;br /&gt;
  {&lt;br /&gt;
    if( disposing )&lt;br /&gt;
    {&lt;br /&gt;
      if (components != null) &lt;br /&gt;
      {&lt;br /&gt;
        components.Dispose();&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    base.Dispose( disposing );&lt;br /&gt;
  }&lt;br /&gt;
  private void InitializeComponent()&lt;br /&gt;
  {&lt;br /&gt;
    this.dataGrid1 = new System.Windows.Forms.DataGrid();&lt;br /&gt;
    this.InsertCommand = new System.Windows.Forms.Button();&lt;br /&gt;
    this.UpdateCommand = new System.Windows.Forms.Button();&lt;br /&gt;
    this.DeleteCommand = new System.Windows.Forms.Button();&lt;br /&gt;
    this.checkBox1 = new System.Windows.Forms.CheckBox();&lt;br /&gt;
    ((System.ruponentModel.ISupportInitialize)(this.dataGrid1)).BeginInit();&lt;br /&gt;
    this.SuspendLayout();&lt;br /&gt;
    // &lt;br /&gt;
    // dataGrid1&lt;br /&gt;
    // &lt;br /&gt;
    this.dataGrid1.DataMember = &amp;quot;&amp;quot;;&lt;br /&gt;
    this.dataGrid1.HeaderForeColor = System.Drawing.SystemColors.ControlText;&lt;br /&gt;
    this.dataGrid1.Location = new System.Drawing.Point(8, 8);&lt;br /&gt;
    this.dataGrid1.Name = &amp;quot;dataGrid1&amp;quot;;&lt;br /&gt;
    this.dataGrid1.Size = new System.Drawing.Size(336, 304);&lt;br /&gt;
    this.dataGrid1.TabIndex = 0;&lt;br /&gt;
    // &lt;br /&gt;
    // InsertCommand&lt;br /&gt;
    // &lt;br /&gt;
    this.InsertCommand.Location = new System.Drawing.Point(368, 24);&lt;br /&gt;
    this.InsertCommand.Name = &amp;quot;InsertCommand&amp;quot;;&lt;br /&gt;
    this.InsertCommand.Size = new System.Drawing.Size(120, 32);&lt;br /&gt;
    this.InsertCommand.TabIndex = 1;&lt;br /&gt;
    this.InsertCommand.Text = &amp;quot;Insert Command&amp;quot;;&lt;br /&gt;
    this.InsertCommand.Click += new System.EventHandler(this.InsertCommand_Click);&lt;br /&gt;
    // &lt;br /&gt;
    // UpdateCommand&lt;br /&gt;
    // &lt;br /&gt;
    this.UpdateCommand.Location = new System.Drawing.Point(368, 72);&lt;br /&gt;
    this.UpdateCommand.Name = &amp;quot;UpdateCommand&amp;quot;;&lt;br /&gt;
    this.UpdateCommand.Size = new System.Drawing.Size(120, 32);&lt;br /&gt;
    this.UpdateCommand.TabIndex = 2;&lt;br /&gt;
    this.UpdateCommand.Text = &amp;quot;Update Command&amp;quot;;&lt;br /&gt;
    this.UpdateCommand.Click += new System.EventHandler(this.UpdateCommand_Click);&lt;br /&gt;
    // &lt;br /&gt;
    // DeleteCommand&lt;br /&gt;
    // &lt;br /&gt;
    this.DeleteCommand.Location = new System.Drawing.Point(368, 120);&lt;br /&gt;
    this.DeleteCommand.Name = &amp;quot;DeleteCommand&amp;quot;;&lt;br /&gt;
    this.DeleteCommand.Size = new System.Drawing.Size(120, 32);&lt;br /&gt;
    this.DeleteCommand.TabIndex = 3;&lt;br /&gt;
    this.DeleteCommand.Text = &amp;quot;Delete Command&amp;quot;;&lt;br /&gt;
    this.DeleteCommand.Click += new System.EventHandler(this.DeleteCommand_Click);&lt;br /&gt;
    // &lt;br /&gt;
    // checkBox1&lt;br /&gt;
    // &lt;br /&gt;
    this.checkBox1.Location = new System.Drawing.Point(368, 192);&lt;br /&gt;
    this.checkBox1.Name = &amp;quot;checkBox1&amp;quot;;&lt;br /&gt;
    this.checkBox1.Size = new System.Drawing.Size(112, 24);&lt;br /&gt;
    this.checkBox1.TabIndex = 4;&lt;br /&gt;
    this.checkBox1.Text = &amp;quot;SqlCommand&amp;quot;;&lt;br /&gt;
    // &lt;br /&gt;
    // InsertDataLoadDataGrid&lt;br /&gt;
    // &lt;br /&gt;
    this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);&lt;br /&gt;
    this.ClientSize = new System.Drawing.Size(496, 325);&lt;br /&gt;
    this.Controls.AddRange(new System.Windows.Forms.Control[] {&lt;br /&gt;
                                    this.checkBox1,&lt;br /&gt;
                                    this.DeleteCommand,&lt;br /&gt;
                                    this.UpdateCommand,&lt;br /&gt;
                                    this.InsertCommand,&lt;br /&gt;
                                    this.dataGrid1});&lt;br /&gt;
    this.Name = &amp;quot;InsertDataLoadDataGrid&amp;quot;;&lt;br /&gt;
    this.Text = &amp;quot;InsertDataLoadDataGrid&amp;quot;;&lt;br /&gt;
    ((System.ruponentModel.ISupportInitialize)(this.dataGrid1)).EndInit();&lt;br /&gt;
    this.ResumeLayout(false);&lt;br /&gt;
  }&lt;br /&gt;
  [STAThread]&lt;br /&gt;
  static void Main() &lt;br /&gt;
  {&lt;br /&gt;
    Application.Run(new InsertDataLoadDataGrid());&lt;br /&gt;
  }&lt;br /&gt;
  private void InsertCommand_Click(object sender, System.EventArgs e)&lt;br /&gt;
    {&lt;br /&gt;
        string ConnectionString = &amp;quot;Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\\Northwind.mdb&amp;quot;;&lt;br /&gt;
        OleDbConnection conn = new OleDbConnection(ConnectionString);&lt;br /&gt;
        DataRow row;&lt;br /&gt;
        DataSet ds = new DataSet();&lt;br /&gt;
        &lt;br /&gt;
        try&lt;br /&gt;
        {&lt;br /&gt;
            conn.Open();&lt;br /&gt;
            OleDbDataAdapter adapter = new OleDbDataAdapter(&lt;br /&gt;
                &amp;quot;SELECT * FROM Customers&amp;quot;, conn);&lt;br /&gt;
            &lt;br /&gt;
      OleDbCommandBuilder cmdBuilder = &lt;br /&gt;
          new OleDbCommandBuilder(adapter);&lt;br /&gt;
        adapter.MissingSchemaAction = &lt;br /&gt;
          MissingSchemaAction.AddWithKey;&lt;br /&gt;
        adapter.Fill(ds, &amp;quot;Customers&amp;quot;);&lt;br /&gt;
        row = ds.Tables[&amp;quot;Customers&amp;quot;].NewRow();&lt;br /&gt;
        row[&amp;quot;CustomerId&amp;quot;] = &amp;quot;001&amp;quot;;&lt;br /&gt;
        row[&amp;quot;ContactName&amp;quot;] = &amp;quot;L&amp;quot;;&lt;br /&gt;
        row[&amp;quot;CompanyName&amp;quot;] = &amp;quot;M&amp;quot;;    &lt;br /&gt;
        ds.Tables[&amp;quot;Customers&amp;quot;].Rows.Add(row);&lt;br /&gt;
    &lt;br /&gt;
            adapter.Update(ds, &amp;quot;Customers&amp;quot;);&lt;br /&gt;
            dataGrid1.DataSource = ds.DefaultViewManager;&lt;br /&gt;
        }&lt;br /&gt;
        catch(OleDbException exp)&lt;br /&gt;
        {&lt;br /&gt;
            MessageBox.Show(exp.Message.ToString());&lt;br /&gt;
        }&lt;br /&gt;
        if(conn.State == ConnectionState.Open)&lt;br /&gt;
            conn.Close();&lt;br /&gt;
    }&lt;br /&gt;
  private void UpdateCommand_Click(object sender, System.EventArgs e)&lt;br /&gt;
    {&lt;br /&gt;
    }&lt;br /&gt;
  private void DeleteCommand_Click(object sender, System.EventArgs e)&lt;br /&gt;
    {&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Update data and reload to DataGrid==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using System;&lt;br /&gt;
using System.Drawing;&lt;br /&gt;
using System.Collections;&lt;br /&gt;
using System.ruponentModel;&lt;br /&gt;
using System.Windows.Forms;&lt;br /&gt;
using System.Data;&lt;br /&gt;
using System.Data.OleDb;&lt;br /&gt;
using System.Data.SqlClient;&lt;br /&gt;
public class UpdateDataLoadDataGrid : System.Windows.Forms.Form&lt;br /&gt;
{&lt;br /&gt;
  private System.Windows.Forms.DataGrid dataGrid1;&lt;br /&gt;
  private System.Windows.Forms.Button InsertCommand;&lt;br /&gt;
  private System.Windows.Forms.Button UpdateCommand;&lt;br /&gt;
  private System.Windows.Forms.Button DeleteCommand;&lt;br /&gt;
  private System.Windows.Forms.CheckBox checkBox1;&lt;br /&gt;
  private System.ruponentModel.Container components = null;&lt;br /&gt;
  public UpdateDataLoadDataGrid()&lt;br /&gt;
  {&lt;br /&gt;
    InitializeComponent();&lt;br /&gt;
  }&lt;br /&gt;
  protected override void Dispose( bool disposing )&lt;br /&gt;
  {&lt;br /&gt;
    if( disposing )&lt;br /&gt;
    {&lt;br /&gt;
      if (components != null) &lt;br /&gt;
      {&lt;br /&gt;
        components.Dispose();&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    base.Dispose( disposing );&lt;br /&gt;
  }&lt;br /&gt;
  private void InitializeComponent()&lt;br /&gt;
  {&lt;br /&gt;
    this.dataGrid1 = new System.Windows.Forms.DataGrid();&lt;br /&gt;
    this.InsertCommand = new System.Windows.Forms.Button();&lt;br /&gt;
    this.UpdateCommand = new System.Windows.Forms.Button();&lt;br /&gt;
    this.DeleteCommand = new System.Windows.Forms.Button();&lt;br /&gt;
    this.checkBox1 = new System.Windows.Forms.CheckBox();&lt;br /&gt;
    ((System.ruponentModel.ISupportInitialize)(this.dataGrid1)).BeginInit();&lt;br /&gt;
    this.SuspendLayout();&lt;br /&gt;
    // &lt;br /&gt;
    // dataGrid1&lt;br /&gt;
    // &lt;br /&gt;
    this.dataGrid1.DataMember = &amp;quot;&amp;quot;;&lt;br /&gt;
    this.dataGrid1.HeaderForeColor = System.Drawing.SystemColors.ControlText;&lt;br /&gt;
    this.dataGrid1.Location = new System.Drawing.Point(8, 8);&lt;br /&gt;
    this.dataGrid1.Name = &amp;quot;dataGrid1&amp;quot;;&lt;br /&gt;
    this.dataGrid1.Size = new System.Drawing.Size(336, 304);&lt;br /&gt;
    this.dataGrid1.TabIndex = 0;&lt;br /&gt;
    // &lt;br /&gt;
    // InsertCommand&lt;br /&gt;
    // &lt;br /&gt;
    this.InsertCommand.Location = new System.Drawing.Point(368, 24);&lt;br /&gt;
    this.InsertCommand.Name = &amp;quot;InsertCommand&amp;quot;;&lt;br /&gt;
    this.InsertCommand.Size = new System.Drawing.Size(120, 32);&lt;br /&gt;
    this.InsertCommand.TabIndex = 1;&lt;br /&gt;
    this.InsertCommand.Text = &amp;quot;Insert Command&amp;quot;;&lt;br /&gt;
    this.InsertCommand.Click += new System.EventHandler(this.InsertCommand_Click);&lt;br /&gt;
    // &lt;br /&gt;
    // UpdateCommand&lt;br /&gt;
    // &lt;br /&gt;
    this.UpdateCommand.Location = new System.Drawing.Point(368, 72);&lt;br /&gt;
    this.UpdateCommand.Name = &amp;quot;UpdateCommand&amp;quot;;&lt;br /&gt;
    this.UpdateCommand.Size = new System.Drawing.Size(120, 32);&lt;br /&gt;
    this.UpdateCommand.TabIndex = 2;&lt;br /&gt;
    this.UpdateCommand.Text = &amp;quot;Update Command&amp;quot;;&lt;br /&gt;
    this.UpdateCommand.Click += new System.EventHandler(this.UpdateCommand_Click);&lt;br /&gt;
    // &lt;br /&gt;
    // DeleteCommand&lt;br /&gt;
    // &lt;br /&gt;
    this.DeleteCommand.Location = new System.Drawing.Point(368, 120);&lt;br /&gt;
    this.DeleteCommand.Name = &amp;quot;DeleteCommand&amp;quot;;&lt;br /&gt;
    this.DeleteCommand.Size = new System.Drawing.Size(120, 32);&lt;br /&gt;
    this.DeleteCommand.TabIndex = 3;&lt;br /&gt;
    this.DeleteCommand.Text = &amp;quot;Delete Command&amp;quot;;&lt;br /&gt;
    this.DeleteCommand.Click += new System.EventHandler(this.DeleteCommand_Click);&lt;br /&gt;
    // &lt;br /&gt;
    // checkBox1&lt;br /&gt;
    // &lt;br /&gt;
    this.checkBox1.Location = new System.Drawing.Point(368, 192);&lt;br /&gt;
    this.checkBox1.Name = &amp;quot;checkBox1&amp;quot;;&lt;br /&gt;
    this.checkBox1.Size = new System.Drawing.Size(112, 24);&lt;br /&gt;
    this.checkBox1.TabIndex = 4;&lt;br /&gt;
    this.checkBox1.Text = &amp;quot;SqlCommand&amp;quot;;&lt;br /&gt;
    // &lt;br /&gt;
    // UpdateDataLoadDataGrid&lt;br /&gt;
    // &lt;br /&gt;
    this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);&lt;br /&gt;
    this.ClientSize = new System.Drawing.Size(496, 325);&lt;br /&gt;
    this.Controls.AddRange(new System.Windows.Forms.Control[] {&lt;br /&gt;
                                    this.checkBox1,&lt;br /&gt;
                                    this.DeleteCommand,&lt;br /&gt;
                                    this.UpdateCommand,&lt;br /&gt;
                                    this.InsertCommand,&lt;br /&gt;
                                    this.dataGrid1});&lt;br /&gt;
    this.Name = &amp;quot;UpdateDataLoadDataGrid&amp;quot;;&lt;br /&gt;
    this.Text = &amp;quot;UpdateDataLoadDataGrid&amp;quot;;&lt;br /&gt;
    ((System.ruponentModel.ISupportInitialize)(this.dataGrid1)).EndInit();&lt;br /&gt;
    this.ResumeLayout(false);&lt;br /&gt;
  }&lt;br /&gt;
  [STAThread]&lt;br /&gt;
  static void Main() &lt;br /&gt;
  {&lt;br /&gt;
    Application.Run(new UpdateDataLoadDataGrid());&lt;br /&gt;
  }&lt;br /&gt;
  private void InsertCommand_Click(object sender, System.EventArgs e)&lt;br /&gt;
    {&lt;br /&gt;
    }&lt;br /&gt;
  private void UpdateCommand_Click(object sender, System.EventArgs e)&lt;br /&gt;
    {&lt;br /&gt;
        string ConnectionString = &amp;quot;Provider=Microsoft.Jet.OLEDB.4.0;&amp;quot;+&lt;br /&gt;
            &amp;quot;Data Source=c:\\Northwind.mdb&amp;quot;;&lt;br /&gt;
        OleDbConnection conn = &lt;br /&gt;
            new OleDbConnection(ConnectionString);&lt;br /&gt;
        DataSet ds = new DataSet();&lt;br /&gt;
        &lt;br /&gt;
        try&lt;br /&gt;
        {&lt;br /&gt;
            conn.Open();&lt;br /&gt;
            OleDbDataAdapter adapter = new OleDbDataAdapter(&lt;br /&gt;
                &amp;quot;SELECT * FROM Customers&amp;quot;, conn);&lt;br /&gt;
            &lt;br /&gt;
            OleDbCommandBuilder cmdBuilder = &lt;br /&gt;
                new OleDbCommandBuilder(adapter);&lt;br /&gt;
            adapter.MissingSchemaAction = &lt;br /&gt;
                MissingSchemaAction.AddWithKey;&lt;br /&gt;
            adapter.Fill(ds, &amp;quot;Customers&amp;quot;);&lt;br /&gt;
            DataRow row1 = ds.Tables[&amp;quot;Customers&amp;quot;].Rows.Find(&amp;quot;001&amp;quot;);&lt;br /&gt;
            row1[&amp;quot;ContactName&amp;quot;]=&amp;quot;S&amp;quot;;&lt;br /&gt;
            row1[&amp;quot;CompanyName&amp;quot;] = &amp;quot;M&amp;quot;;    &lt;br /&gt;
            &lt;br /&gt;
            adapter.Update(ds, &amp;quot;Customers&amp;quot;);&lt;br /&gt;
            dataGrid1.DataSource = ds.DefaultViewManager;&lt;br /&gt;
        }&lt;br /&gt;
        catch(OleDbException exp)&lt;br /&gt;
        {&lt;br /&gt;
            MessageBox.Show(exp.Message.ToString());&lt;br /&gt;
        }&lt;br /&gt;
        if(conn.State == ConnectionState.Open)&lt;br /&gt;
            conn.Close();                   &lt;br /&gt;
    }&lt;br /&gt;
  private void DeleteCommand_Click(object sender, System.EventArgs e)&lt;br /&gt;
    {&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>