Results 1 to 5 of 5

Thread: How to Use the MySQL Data Reader?

  1. #1
    Join Date
    Jul 2006
    Posts
    286

    How to Use the MySQL Data Reader?

    Hi Friends,
    I know little bit about the data reader. I think that it supports the Microsoft .NET framework. I am using the MySQL application. And I want to use the MySQL data reader. But I don't know how to use that. Anyone out there can explain me how to Use the MySQL Data Reader.?? It would be much better if you provide some sample of coding.!!
    IF you hate me, please don't mention it. I know who hates me and who doesn't. You really do not have to make fun of people....

  2. #2
    Join Date
    Apr 2008
    Posts
    1,948

    Re: How to Use the MySQL Data Reader?

    I think that first you should know about the data reader which you are going to use in MySQL. By using the data reader you can access the contents of a database in .NET. You should be knowing that the database like Access supports the Microsoft .NET framework. So the plus point of data reader in MySQL is that it is simplest .NET method of accessing the contents of a database. You acn run any valid SQL select statement on the database. By doing this the results of the query will get returned to the client application. It cannot, therefore, be used to insert, update or delete records held in database tables.

  3. #3
    Join Date
    Apr 2008
    Posts
    2,005

    Re: How to Use the MySQL Data Reader?

    You will have to know some things before using the MySQL Data Reader. Before using any objects of .NET it should be loaded. In simple way you can say that the MySQL .NET connector must be loaded before its objects can be used in an application. I know how to load the objects in C#. The following code can be used in C# for loading :
    Code:
    using MySQL.Data.MySQLClient;
    With that in place a connection can be made to the database.

  4. #4
    Join Date
    Mar 2008
    Posts
    672

    Re: How to Use the MySQL Data Reader?

    Many times you get an error like "Invalid attempt to access a field before calling Read()". Actually such problems are not caused because of data readers, but has caused because of the wrong coding in the program. You can connect to the MySQL Server by using the following command :
    Code:
    %>mysql [options] [database]
    In the above coding [options] can be one or a series of options used in conjunction and [database] is the name of the database. For assigning privileges to users and to create new user, you can use the GRANT function.

  5. #5
    Join Date
    May 2008
    Posts
    2,012

    Re: How to Use the MySQL Data Reader?

    Before going to the process of using the MySQL Data Reader you should know how to create it. You can create the Data Reader in following two steps :
    • You can create the data reader using the SQL command.
    • Or you can create SQL command by using the database connection.

    Since I know the PowerShell language, the code to create the SQL command in it is :
    Code:
    $command = $connection.CreateCommand()
    $command.CommandText = "select * from tables";

Similar Threads

  1. How to edit or delete data in MySQL
    By Algernon in forum Software Development
    Replies: 4
    Last Post: 31-12-2010, 07:13 AM
  2. MySQL: Entering data in tables
    By Botan in forum Software Development
    Replies: 2
    Last Post: 22-12-2010, 05:44 AM
  3. Replies: 3
    Last Post: 07-11-2009, 09:36 PM
  4. How to Insert data into MySQL table
    By Mahendra varma in forum Software Development
    Replies: 4
    Last Post: 04-10-2009, 04:42 AM
  5. Data Types in MySQL
    By Jacek01 in forum Software Development
    Replies: 2
    Last Post: 10-02-2009, 03:08 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,711,711,482.38043 seconds with 17 queries