... 3.14 Using the Shape Language to Retrieve Hierarchical Data
Problem
You want to use the Shape language with ADO.NET to retrieve hierarchical data from a
SQL Server.
Solution
Execute the SHAPE ... shown in the following example using the OLE DB
provider.
The sample code defines a SHAPE query to retrieve the TOP 5 Orders from Northwind...
...
Using the Get* Methods to Read Column Values
Before I show you the other Get* methods that read column values, you need to know the
standard C# types and the values they support. You need to ... 2
16
- 1 (65,535).
Note The standard C# types are defined in the System namespace.
Table 9.4
shows the SQL Server types, the compatible standard C# types, and the
Data...
... script is similar to the ActionScript we added in the preceding step. However,
here the if statement reacts to the Up and Down Arrow keys rather than the Right
and Left Arrow keys. The first part ... whether the Tab key
is currently pressed down. It returns a result of either true or false. The parameter of the
isDown() method can reference either a specific key in...
... for the XmlDocument class. The DataSet property (type DataSet) is
the property added to the XmlDataDocument class. It gets the DataSet object, which
stored the relational representation of the ... data. You associate a DataSet with your
XmlDataDocument by passing the DataSet to the XmlDataDocument constructor. Table
16.8 shows the additional XmlDataDocument methods...
...
Using an XmlDocument Object to Store an XML Document
You use an object of the XmlDocument class to represent an XML document in a C#
program. An XmlDocument object stores the nodes of the ... XML document.
You can then use the output string from GetXml() as the input to the LoadXml()
method of myXmlDocument; this loads myXmlDocument with the XML
document containing...
... Choosing the data connection
7. Click the Next button to continue.
8. You now log in to the database by specifying the password for the database user.
You used the sa user when creating the database ...
shows the completed form up and running. Notice that the top part of the form shows the
details for the row from the Customers table where the CustomerID...
... 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 value will be displayed in the ... All The Cancel All button allows you to undo any changes you've
made to the current row.
o
Add The Add button allows you to add a new row.
o
Delete The...
... information message
produced by the database. You use the InfoMessage event to monitor these messages. To
get the message, you read the contents of the Errors collection from the
SqlInfoMessageEventArgs ... you can see, the time to open the first connection is relatively long compared with the
subsequent ones. This is because the first connection makes the actu...
...
Unspecified. Within the transaction, a DataTable is filled with the Orders table
from the Northwind database. The default view of the table is bound to the data
grid on the form.
Cancel Button.Click ...
committed, by another transaction. The first transaction makes
more changes to the data or rolls back the changes already made
resulting in the second tran...
... Using the Connection Object
As with ADO.NET, you will be using the Connection object to set up a connection to the
database of your choice.
As you get started looking at the different ...
Listing A.3 provides two other examples of using the connection object, also found in
basConnectionExamples.vb. The first is code to open a connection to a Jet database by
usi...