Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

mysql executeScalar only if successful

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

if (userNameObj != null)
  string returnedName = userNameObj.ToString();
 ...
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #mysql #executeScalar #successful
ADD COMMENT
Topic
Name
3+6 =