您当前的位置: 首页 >  unity

苍狼王unity学院

暂无认证

  • 4浏览

    0关注

    305博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

c#基于unity连接Mysql数据库08_增、删、改、查

苍狼王unity学院 发布时间:2019-08-13 18:07:39 ,浏览量:4

1、直接上代码:

    {
        static void Main(string[] args)
        {
            string connStr = "Database=game01;datasource=127.0.0.1;port=3306;user=root;pwd=root;";
            MySqlConnection conn = new MySqlConnection(connStr);

            conn.Open();

            #region 查询
            //MySqlCommand cmd = new MySqlCommand("select * from user", conn);

            //MySqlDataReader reader = cmd.ExecuteReader();

            //while (reader.Read())
            //{
            //    string username = reader.GetString("username");
            //    string password = reader.GetString("password");
            //    Console.WriteLine(username + ":" + password);
            //}

            //reader.Close();
            #endregion

            #region 插入
            string username = "cwer"; string password = "lcker';del
关注
打赏
1665389160
查看更多评论
立即登录/注册

微信扫码登录

0.3852s