Solved

c# mysql

Posted on 2010-11-29
1
347 Views
Last Modified: 2012-05-10
MySqlConnection ,  MySqlDataReader, MySqlCommand

how can w know what those function mean and what they do if i want to write some thing to mysql databate such as update I can put sql statement to  MySqlCommand or not
private void button1_Click(object sender, EventArgs e)
        {
            string MyConString = "SERVER=localhost;" +
                "DATABASE=registration;" +
                "UID=root;" +
                "PASSWORD='';";
            MySqlConnection connection = new MySqlConnection(MyConString);
            MySqlCommand command = connection.CreateCommand();
            MySqlDataReader Reader;
            command.CommandText = "select * from teera";
            connection.Open();
            Reader = command.ExecuteReader();
            while (Reader.Read())
            {
                string thisrow = "";
                for (int i = 0; i < Reader.FieldCount; i++)
                    thisrow += Reader.GetValue(i).ToString() + ",";
                listBox1.Items.Add(thisrow);
                System.IO.File.AppendAllText(@"C:\file.txt", "thisrow");

Open in new window

0
Comment
Question by:teera
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
ID: 34236064
>>  MySqlConnection ,  MySqlDataReader, MySqlCommand

Those are classes, not functions. You can follow-up with the documentation to see what they do and what is available with each:  http://dev.mysql.com/doc/refman/5.1/en/connector-net-ref-mysqlclient.html

In short, MySqlConnection represents a connection to a MySql database, MySqlCommand is a class that is used to pass queries to the database using a given MySqlConnection, and MySqlDataReader is a class used to read the results of a selection query processed by a given SqlCommand object.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question