s GETTING TO KNOW ADO.NET in VB.NET

Make ECC200 in VB.NET s GETTING TO KNOW ADO.NET

CHAPTER 9 s GETTING TO KNOW ADO.NET
Paint Data Matrix In Visual Basic .NET
Using Barcode generation for .NET framework Control to generate, create Data Matrix image in VS .NET applications.
www.OnBarcode.com
Recognize Data Matrix In VB.NET
Using Barcode decoder for .NET Control to read, scan read, scan image in .NET applications.
www.OnBarcode.com
The final change was a semantic one and wasn t required by ADO.NET: ' Display output header Console.WriteLine("This program demonstrates the use of " & _ "the OLE DB Data Provider.")
Barcode Generation In Visual Basic .NET
Using Barcode printer for VS .NET Control to generate, create Barcode image in Visual Studio .NET applications.
www.OnBarcode.com
Code 128A Maker In VB.NET
Using Barcode generator for Visual Studio .NET Control to generate, create Code128 image in .NET applications.
www.OnBarcode.com
Working with the ODBC Data Provider
PDF 417 Creator In Visual Basic .NET
Using Barcode printer for .NET Control to generate, create PDF 417 image in Visual Studio .NET applications.
www.OnBarcode.com
Code 3/9 Creator In VB.NET
Using Barcode maker for Visual Studio .NET Control to generate, create Code 3 of 9 image in .NET framework applications.
www.OnBarcode.com
ODBC was Microsoft s original general-purpose data access technology. It s still widely used for data sources that don t have OLE DB providers or .NET Framework data providers. ADO.NET includes an ODBC data provider in the namespace System.Data.Odbc. The ODBC architecture is essentially a three-tier process. An application uses ODBC functions to submit database requests. ODBC converts the function calls to the protocol (call-level interface) of a driver specific to a given data source. The driver communicates with the data source, passing any results or errors back up to ODBC. Obviously this is less efficient than a database-specific data provider s direct communication with a database, so for performance it s preferable to avoid the ODBC data provider, since it merely offers a simpler interface to ODBC but still involves all the ODBC overhead. Table 9-5 describes some important classes in the Odbc namespace. Table 9-5. Commonly Used Odbc Classes
Print DataMatrix In Visual Basic .NET
Using Barcode creation for VS .NET Control to generate, create DataMatrix image in Visual Studio .NET applications.
www.OnBarcode.com
Encoding ISSN In Visual Basic .NET
Using Barcode maker for .NET Control to generate, create ISSN image in Visual Studio .NET applications.
www.OnBarcode.com
Classes
Painting ECC200 In .NET Framework
Using Barcode encoder for Reporting Service Control to generate, create Data Matrix 2d barcode image in Reporting Service applications.
www.OnBarcode.com
Data Matrix Decoder In Java
Using Barcode decoder for Java Control to read, scan read, scan image in Java applications.
www.OnBarcode.com
OdbcCommand OdbcConnection OdbcDataAdapter OdbcDataReader OdbcError OdbcParameter OdbcTransaction
Making Barcode In None
Using Barcode drawer for Office Excel Control to generate, create Barcode image in Microsoft Excel applications.
www.OnBarcode.com
Generating EAN / UCC - 13 In None
Using Barcode encoder for Software Control to generate, create EAN128 image in Software applications.
www.OnBarcode.com
Description
Recognize PDF-417 2d Barcode In Visual Studio .NET
Using Barcode decoder for .NET Control to read, scan read, scan image in VS .NET applications.
www.OnBarcode.com
Create QR-Code In Objective-C
Using Barcode creation for iPhone Control to generate, create Quick Response Code image in iPhone applications.
www.OnBarcode.com
Executes SQL queries, statements, or stored procedures Represents a connection to an ODBC data source Represents a bridge between a dataset and a data source Provides a forward-only, read-only data stream of rows from a data source Holds information on errors and warnings returned by the data source Represents a command parameter Represents a SQL transaction
Making UPCA In None
Using Barcode creator for Online Control to generate, create UPC A image in Online applications.
www.OnBarcode.com
Code-128 Generator In Java
Using Barcode generator for Java Control to generate, create Code 128A image in Java applications.
www.OnBarcode.com
Let s use the ODBC data provider to access the Northwind database, making the same kind of straightforward changes (highlighted later in this chapter in Listing 9-3) to the code in Listing 9-1 as you did in using the OLE DB data provider. Before you do, though, you need to create an ODBC data source actually, you configure a DSN (data source name) for use with a data source accessible by ODBC for the Northwind database, since, unlike the SQL Server and OLE DB data providers, the ODBC data provider doesn t let you specify the server or database in the connection string. (The following works on Windows XP and the process is similar for other versions of Windows.) ,
Encode Barcode In Visual Studio .NET
Using Barcode printer for ASP.NET Control to generate, create Barcode image in ASP.NET applications.
www.OnBarcode.com
Barcode Drawer In Java
Using Barcode generation for Android Control to generate, create Barcode image in Android applications.
www.OnBarcode.com
CHAPTER 9 s GETTING TO KNOW ADO.NET
Generate EAN128 In Java
Using Barcode drawer for BIRT reports Control to generate, create GS1 128 image in BIRT reports applications.
www.OnBarcode.com
Barcode Creator In None
Using Barcode encoder for Font Control to generate, create Barcode image in Font applications.
www.OnBarcode.com
Creating an ODBC Data Source
To create an ODBC data source, follow these steps: 1. In the Control Panel, double-click Administrative Tools (see Figure 9-6).
Figure 9-6. Control Panel: Administrative Tools 2. In Administrative Tools, double-click Data Sources (ODBC) (see Figure 9-7). 3. When the ODBC Data Source Administrator window opens, click the User DSN tab and then click Add (see Figure 9-8).
CHAPTER 9 s GETTING TO KNOW ADO.NET
Figure 9-7. Administrative Tools: Data Sources (ODBC)
Figure 9-8. ODBC Data Source Administrator dialog box
CHAPTER 9 s GETTING TO KNOW ADO.NET
4. The Create New Data Source wizard starts. Follow its instructions carefully! First, select the SQL Server driver; second, click Finish (see Figure 9-9).
Figure 9-9. Create New Data Source wizard 5. The next window prompts for the data source name and server. Specify the values for Name and Server as NorthwindOdbc and .\sqlexpress, respectively, as shown in Figure 9-10, and then click Next.
Figure 9-10. Specifying the data source name and SQL Server to connect to
CHAPTER 9 s GETTING TO KNOW ADO.NET
6. Accept the defaults in the authentication window by clicking Next (see Figure 9-11).
Figure 9-11. Specifying SQL Server authentication 7. In the next window, check the Change the Default Database To option, select the Northwind database from the provided drop-down list, and click Next (see Figure 9-12).
Figure 9-12. Specifying the default database
CHAPTER 9 s GETTING TO KNOW ADO.NET
8. In the next window, simply click Finish (see Figure 9-13).
Figure 9-13. Finishing DSN creation 9. A confirmation window appears, describing the new data source. Click Test Data Source (see Figure 9-14).
Figure 9-14. Testing the Northwind data source connection
CHAPTER 9 s GETTING TO KNOW ADO.NET
10. A window reporting a successful test should appear (see Figure 9-15). (If it doesn t, cancel your work and carefully try again.) Click OK.
Figure 9-15. Connection to Northwind was successful. 11. When the confirmation window reappears, click OK. When the ODBC Data Source Administrator window reappears, the new data source will be on the list (see Figure 9-16). Click OK.
Figure 9-16. New data source appearing in the data source list Now you have your NorthwindOdbc data source ready to work with. Next, you will use it in code for setting up the connection string.
Copyright © OnBarcode.com . All rights reserved.