C#操作MySql数据库范例源码

下边资料是关于C#操作MySql数据库范例的代码,应该是对各朋友有一些用。

using MySql.Data.MySqlClient;


            MySqlConnection conn = new MySqlConnection(connectString);

            conn.Open ();

            MySqlCommand cmd = conn.CreateCommand();


            cmd.CommandType = CommandType.Text;

            using (MySqlDataReader reader = cmd.ExecuteReader())

            {

                while (reader.Read())

                  Console.WriteLine(reader[0].ToString());

            }

猜你喜欢

转载自blog.csdn.net/weixin_44531419/article/details/86490801