ADO.NET Cookbook by Bill Hamilton

By Bill Hamilton

Bargains 153 options, whole with code and causes, to difficulties more often than not encountered whilst utilizing ADO.NET to aid info entry in loosely coupled n-tier software architectures. The options show find out how to hook up with information assets from ADO.NET, retrieve information utilizing SQL statements, look for documents in perspectives and tables, reproduction info among ADO.NET periods, bind information to types, and increase program functionality. The code examples are written in C#.

Show description

Read or Download ADO.NET Cookbook PDF

Similar visual basic books

VBScript in nutshell

VBScript in a Nutshell makes a speciality of the whole VBScript language, and illustrates the knowledge forms, variables, constants, arrays, statements, and capabilities that shape the middle elements of the language. The publication units forth a close dialogue of ways to name scripts and explains the similarities and ameliorations among VBScript and visible simple and the way VBScript differs from JavaScript.

Visual Basic Programmer's Guide to the .NET Framework Class Library (Kaleidoscope)

Yet why do VB whilst c# is simply as effortless and you'll write unmanaged inside of it. Its only a no brainer with all of the obstacles of VB nonetheless.

Developer's Guide to Microsoft Enterprise Library, Visual Basic Edition (Patterns & Practices)

Welcome to the period of software program reuse! Microsoft firm Library is helping speed up improvement by way of delivering reusable parts and suggestions on confirmed practices. in the event you construct functions that run at the Microsoft . web Framework, whether or not they are enterprise-level enterprise functions or maybe particularly modest home windows® varieties, home windows Presentation starting place (WPF), home windows conversation beginning (WCF), or ASP.

C++/CLI: The Visual C++ Language for .NET

C++/CLI: The visible C++ Language for . web introduces Microsoft's extensions to the C++ syntax that let you aim the typical language runtime the main to the guts of the . internet three. zero platform. In 12 no-fluff chapters, Microsoft insider Gordon Hogenson takes you into the center of the C++/CLI language and explains either how the language components paintings and the way Microsoft intends them for use.

Extra resources for ADO.NET Cookbook

Sample text

EventArgs e) { String sqlText = "SELECT Subject, Contents FROM Inbox"; // Build the connection string. GetTempPath( ); // Create the DataAdapter. OleDbDataAdapter da = new OleDbDataAdapter(sqlText, connectionString); // Create and fill the table. 5 interfaces including the Microsoft OLE DB Provider for Exchange. The Jet OLE DB provider can access an Outlook or Exchange store. 0;MAPILEVEL=Personal Folders|; PROFILE=Outlook;TABLETYPE=0;DATABASE=c:\temp; The connection string attributes-and-value pairs are described in Table 1-1.

The ChangeDatabase( ) method is used to change the current database for an open connection. It takes a single parameter that specifies the name of the database to use in place of the current database. The name of the database must be valid or an ArgumentException will be raised. If the connection is not open when the method is called, an InvalidOperationException is raised. A provider-specific exception is raised if the database cannot be changed for any reason. The Database property of the Connection object is updated dynamically and returns the current database for an open connection or the name of a database that will be used by a closed connection when it is opened.

When the Connection is closed after ChangeDatabase( ) is called, the database is reset to that specified in the original connection string. NET to access data stored in a text file. Solution Use the OLE DB Jet provider to access data in a text file. txt, shown in Example 1-13, into a 57 58 DataTable and displays the contents in a data grid on the form. Example 1-13. txt "CategoryID","CategoryName","Description" 1,"Beverages","Soft drinks, coffees, teas, beers, and ales" 2,"Condiments","Sweet and savory sauces, relishes, spreads, and seasonings" 3,"Confections","Desserts, candies, and sweet breads" 4,"Dairy Products","Cheeses" 5,"Grains/Cereals","Breads, crackers, pasta, and cereal" 6,"Meat/Poultry","Prepared meats" 7,"Produce","Dried fruit and bean curd" 8,"Seafood","Seaweed and fish" The C# code is shown in Example 1-14.

Download PDF sample

Rated 4.18 of 5 – based on 42 votes