mysql executeScalar only if successful

74

mysql executeScalar only if successful -

MySqlCommand cmd = new MySqlCommand(connection);
cmd.CommandText = sqlstring;
Object userNameObj = cmd.ExecuteScalar();

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

Comments

Submit
0 Comments