C# with MySQL INSERT parameters

后端 未结 9 1959
-上瘾入骨i
-上瘾入骨i 2020-11-28 10:47

Good day to all, I\'m using Visual C# 2010 and MySQL Version 5.1.48-community. I hope you can help me with this code. I don\'t find it working on me. What am I missing?

9条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-28 11:34

    try this it is working

     MySqlCommand dbcmd = _conn.CreateCommand();
        dbcmd.CommandText = sqlCommandString;
        dbcmd.ExecuteNonQuery();
        long imageId = dbcmd.LastInsertedId;
    

提交回复
热议问题