c# 连接mysql

MySqlConnection connection = new MySqlConnectio(connectionString);
            using (MySqlCommand cmd = new MySqlCommand(safeSql, connection))
            {
                try
                {
                    connection.Open();
                    return cmd.ExecuteNonQuery();
                }
                catch (Exception ex)
                {
                    connection.Close();
                          return 0;
                }

            } 
posted @ 2011-04-18 22:26  V587  阅读(232)  评论(2编辑  收藏  举报