In this tutorial, you will see how easy it is to bind to simple database table data using DataObjects for .NET Express Edition. Complete the following steps:
Number of Components | Name | Namespace |
---|---|---|
1 C1ExpressTable | C1ExpressTable1 | C1.Data.Express.C1ExpressTable |
1 DataGridView | DataGridView1 | System.Windows.Forms.DataGridView |
1 Label | Label1 | System.Windows.Forms.Label |
1 CheckBox | CheckBox1 | System.Windows.Forms.CheckBox |
1 command Button | Button1 | System.Windows.Forms.Button |
Close the program and return to the design time environment. Next you'll access DataObjects for .NET Express data programmatically in code.
To write code in Visual Basic
Visual Basic |
Copy Code
|
---|---|
Label1.Text = "Row count: " + c1ExpressTable1.DataTable.Rows.Count.ToString() |
To write code in C#
C# |
Copy Code
|
---|---|
label1.Text = "Row count: " + c1ExpressTable1.DataTable.Rows.Count.ToString(); |
To write code in Visual Basic
Visual Basic |
Copy Code
|
---|---|
C1ExpressTable1.ExpressConnection.Update() |
To write code in C#
C# |
Copy Code
|
---|---|
c1ExpressTable1.ExpressConnection.Update(); |
To write code in Visual Basic
Visual Basic |
Copy Code
|
---|---|
C1ExpressTable1.UpdateLeavingRow = checkBox1.Checked |
To write code in C#
C# |
Copy Code
|
---|---|
c1ExpressTable1.UpdateLeavingRow = checkBox1.Checked; |