Web Form 新增 TextBox5 輸入要刪除記錄的 name,按鈕程式碼:
System.Data.OleDb.OleDbCommand oleDeleteCommand1 = new System.Data.OleDb.OleDbCommand();
this.oleDbDataAdapter1.DeleteCommand = oleDeleteCommand1;
oleDeleteCommand1.CommandText = "DELETE FROM ADDRESS WHERE NAME='" + TextBox5.Text + "'";
oleDeleteCommand1.Connection = this.oleDbConnection1;
oleDeleteCommand1.Connection.Open();
oleDeleteCommand1.ExecuteNonQuery();
oleDeleteCommand1.Connection.Close();
增/刪/改後 DataGrid 重新整理:重新執行 Select SQL。
中文 Windows 2000 Server + IBM DB2 + Visual Studio .NET Beta 2 編譯執行正常。