📜  mysql 仅在成功时才执行标量 - C# 代码示例

📅  最后修改于: 2022-03-11 14:49:15.538000             🧑  作者: Mango

代码示例1
MySqlCommand cmd = new MySqlCommand(connection);
cmd.CommandText = sqlstring;
Object userNameObj = cmd.ExecuteScalar();

if (userNameObj != null)
  string returnedName = userNameObj.ToString();
 ...