Solved

c# mysql

Posted on 2010-11-29
1
304 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
1 Comment
 
LVL 74

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
Comment Utility
>>  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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
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…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now