Cách đưa ra câu hỏi xác nhận việc xóa một dòng dữ liệu khi bạn click nút xóa trên BindingNavigator tự phát sinh khi bạn kéo DataSource và form design (phát sinh mã tự động)
In order to add new records into a dataset, a new data row must be created and added to the DataRow collection of a data table. The following procedure details how to insert additional rows into a DataTable object in a dataset. For this example, it is assumed the ExistingTable is in a dataset and has two columns named FirstName and LastName.
Call a data table’s NewRow method to create a new, blank record. This new record inherits its column structure from the data table’s DataColumnCollection.
' Visual Basic
Dim anyRow as DataRow = ExistingTable.NewRow
// C#
DataRow anyRow = ExistingTable.NewRow();
Update the new row as if it were an existing record.
' Visual Basic
anyRow(0) = "Money"
anyRow(1) = "Phan"
' or
anyRow("FirstName") = "Money"
anyRow("LastName") = "Phan"
// C#
anyRow[0] = “Money”;
anyRow[1] = “Phan”;
// or
anyRow["FirstName"] = “Money”;
anyRow["LastName"] = “Phan”;
Inserting New Records with Typed Datasets
' Visual Basic
ExistingTable.Rows.Add(anyRow)
// C#
ExistingTable.Rows.Add(anyRow);
* The following example illustrates the same three steps above, except this time the code is modified for use with a typed dataset:
' Visual Basic
Dim anyRow as DataRow = DatasetName.ExistingTable.NewRow
anyRow.FirstName = "Jay"
anyRow.LastName = "Stevens"
ExistingTable.Rows.Add(anyRow)
// C#
DataRow anyRow = DatasetName.ExistingTable.NewRow();
anyRow.FirstName = "Jay";
anyRow.LastName = "Stevens";
ExistingTable.Rows.Add(anyRow);
Replaces the format item in a specified String with the text equivalent of the value of a specified Object instance.
The following code example demonstrates the standard formatting specifiers for numbers, dates, and enumerations.
VB.NET
C#.NET
All kinds of Third party controls exists to make a tabbed MDI possible. But (Vietnamese as I am) was looking for a good looking, free alternative. I came across DockPanel suite. Dockpanel suite is much more than a tabbed MDI only .
it’s possible to dock panels exactly like in VS.NET 2005. (with the nice looking, user friendly navigation)
VB.NET cũng có hàm SaveSetting, GetSetting như VB6 giúp bạn thao tác với Resgistry, nhưng 2 hàm này chỉ thao tác tại một Location nhất định (location dành riêng cho ứng dụng). Nếu bạn muốn thao tác tai các location khác thì dùng 2 hàm này.
Hôm nay mình đụng phải một đoạn code UPDATE dữ liệu vào Database MS Access. Khi chạy, nó không hề báo lỗi gì cả nhưng dữ liệu không được Update. Đau đầu, tốn nhiều thời gian cho nó một cách thật bực mình.
Biết là dùng đệ quy để làm việc này, tuy nhiên đôi lúc đầu óc lú lẫn mò hoài cũng không ra :P. Giờ làm ra rồi phải đưa lên blog để sau này không bị tốn thời gian như thế này nữa