... Using the Data Form Wizard to Create a Windows Form
In this section, you'll use the VS .NET Data Form Wizard to create a Windows
application that accesses both the Customers and Orders ... in to the database by specifying the password for the database user.
You used the sa user when creating the database connection earlier, and you
th...
... MyDataForm : System .Windows. Forms .Form
{
public static void Main()
{
Application.Run(new MyDataForm());
}
This code creates a new object of the MyDataForm class, causing your form to ... editCustomerID is bound to the CustomerID
column of the Customers table. This means that when you run the form and load data
from the database, the CustomerID column...
... Team LiB ]
Recipe 1.13 Using the Data Link Properties Dialog Box
Problem
You want to display the Data Link Properties dialog
b
ox from an application so that users
can create their own database ... code is shown in Example 1-10
.
Example 1-10. File: DataLinkDialogForm.cs
// Namespaces, variables, and constants
using System;
// . . .
private void dataLinkDialogBu...
... to JOIN and GROUP BY syntax that you can use to
access parent/child data and associated summary data.
The connection string using data shaping is shown here:
Provider=MSDataShape ;Data Provider=SQLOLEDB ;Data ... as a field in the data reader with a data type of Object that is a
DataReader.
Hierarchical result sets combine the results for multiple queries into...
...
Adding a DataRow to a DataTable
In this section, you'll learn how to add a DataRow to a DataTable. First, the following
code creates a DataSet object named myDataSet and populates it by calling ... steps to remove a DataRow
from a DataTable. Notice that the ProductID to modify is passed as a parameter:
public static void RemoveDataRow(
DataTable myDat...
... between 0 and 2
8
- 1 (25 5).
char Char A 16-bit Unicode character.
DateTime DateTime A date and time between 12: 00:00 AM January 1, 0001 and
11:59:59 PM December 31, 9999.
decimal Decimal A fixed ... can see the SQL Server types and the values supported by those types in Table
2. 3 of Chapter 2, "Introduction to Databases."
Note The Get* methods are defin...
... Background, Balloon, and Actions. On the
Balloon layer, you'll see a movie clip instance of a hot air balloon with an instance
name of balloon_mc. The Background layer simply displays an image. ...
• Adding a Listener that watches for a key event
• Determining whether a certain key (such as Caps Lock) is toggled on or off
The Key class is a top-level class, which me...
...
class. The EventArgs class is the base class for event data and represents the details of the
event. In the case of the StateChange event, this second object is of the
StateChangeEventArgs ... class.
The following example defines a method named StateChangeHandler to handle the
StateChange event. You'll notice that the second parameter to this method is a...
... examples of using the connection object, also found in
basConnectionExamples.vb. The first is code to open a connection to a Jet database by
using a workgroup file, username, and password. The second ... second is to open a Jet version of
the Northwind database.
Listing A. 3 basConnectionExamples.vb: Two Examples of Opening Jet Databases
Sub DisplayProviderAndSec...
... from the Employees table
In AUTO mode, binary data is returned by default as a reference to the data rather than
the actual data itself. The following example retrieves the EmployeeID and Photo ... Photo="FRwvAAIAAA…"/>
Note I've shown only the first 10 digits of binary data. To view the binary data in Query
Analyzer, you'll need to...