|
It is easy to read a single record from the database using a primary key with the GetRecord() function:
C#:
OrdersRecord myRecord;
string whereStr = "OrderID='10261'";
myRecord = OrdersTable.GetRecord(whereStr);
|
Or:
OrdersRecord myRecord;
myRecord = OrdersTable.Instance.GetRecord("10261", false);
|
Visual Basic .NET, .NET Framework 1.1 and 2.0:
Dim myRecord As OrdersRecord
Dim whereStr As String = "OrderID='10261'"
myRecord = OrdersTable.GetRecord(whereStr)
|
The argument to the GetRecord specifies a whereStr.
Visual Basic .NET, .NET Framework 1.1:
Dim myRecord As OrdersRecord
myRecord = OrdersTable.Instance.GetRecord("10261", False)
|
Visual Basic .NET, .NET Framework 2.0
Dim myRecord As OrdersRecord
myRecord = OrdersTable.GetRecord("10261", False)
|
The first argument to GetRecord specifies the primary key value as a string. Set the second
argument to True if you intend to update the contents of this record so it can be saved in the
database later. Set the second argument to False to fetch a read-only record.
|