Database
  Home arrow Database arrow Page 2 - Database Programming in C# with MySQL : Us...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
DATABASE

Database Programming in C# with MySQL : Using OleDB
By: A.P.Rajshekhar
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 32
    2007-06-18

    Table of Contents:
  • Database Programming in C# with MySQL : Using OleDB
  • OleDB continued
  • Accessing MySQL, Step by Step
  • MySQL Access in the Real World

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Database Programming in C# with MySQL : Using OleDB - OleDB continued


    (Page 2 of 4 )

    OleDbDataAdapter represents a set of commands and a connection that is used to fill a DataSet. In other words it is a bridge between a DataSet and the data source to retrieve and update the data. The constructor of the OleDbDataAdapter needs to be called with a SQL select statement and an OleDbConnection instance. To cite an example, the following creates an instance of an OleDbDataAdapter named adapter:

    OleDbDataAdapter adapter = new OleDbDataAdapter(queryString, conn);

    OleDbDataReader provides a mechanism for reading forward only a stream of records and columns from the data source. To obtain an instance of OleDbDataReader, the executeReader() method of OleDbCommand has to be called. The following statement does the same:

    OleDbDataReader reader = command.ExecuteReader();

    Keep in mind that, while OleDbDataReader is being used, the corresponding connection will be busy, as it uses a stream to communicate with the data source.

    Since the main classes have been discussed, the next step involves understanding how MySQL and the OleDB Data Provider link with each other. The OleDB Data Provider calls the underlying OleDB Provider. So it is the OleDB Provider that communicates with the data source. For each database system, the OleDB Provider has to be provided by the vendor of the database.

    In this case the vendor is MySQL. Hence unless MySQL provides the OleDB Provider, the OleDB Data Provider won't be able to communicate with the database server. The Provider supplied by MySQL has to be registered with .Net so that the OleDB Data Provider can call the Provider. The other term for the OleDB Provider is Database Driver. In the case of MySQL it is also known as the MySQL connector. Next I will be discussing the steps required to access MySQL.  

    More Database Articles
    More By A.P.Rajshekhar


       · In this article I have discussed about using OleDB Data Provider to access MySQL...
       · But in this Article i m getting this error"The 'MySqlProv' provider is not...
       · Nice described in the article. Keep going on!If you would have used ODBC instead...
       · me too getting the same error. some one please let me know the cause for this?
       · Why is the verb "store" not acceptable? "Persist" is an intransitive verb, and...
     

    DATABASE ARTICLES

    - Converting Your Excel Worksheet into a Worki...
    - Excel Reference
    - Database Programming in C# with MySQL : Usin...
    - Formatting Techniques for Data Access from E...
    - Data Access from Excel VBA
    - Generating a Multiple Table Crystal Report u...
    - ADO and the Command Object
    - On Wiring Up an ADO Data Control
    - Reading and Writing to Files on the Intranet
    - Using ADO Record to Create and Navigate Intr...
    - Using Data Access Pages to Access Data on a ...
    - Using ADO with the SQL Native Client
    - ADO`s Stream Object
    - Opening a Record Object Referencing an Open ...
    - Introducing Jasper (SQL Anywhere 10 Beta)





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 Hosted by Hostway
    Stay green...Green IT