Skip to content

Commit 7b17330

Browse files
committed
Make exception message more helpful. Fixes #206
1 parent 8e5a60b commit 7b17330

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/MySqlConnector/MySqlClient/MySqlStatementPreparer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ protected override void OnNamedParameter(int index, int length)
5555
if (parameterIndex != -1)
5656
DoAppendParameter(parameterIndex, index, length);
5757
else if ((m_preparer.m_options & StatementPreparerOptions.AllowUserVariables) == 0)
58-
throw new MySqlException("Parameter '{0}' must be defined.".FormatInvariant(parameterName));
58+
throw new MySqlException("Parameter '{0}' must be defined. To use this as a variable, set 'Allow User Variables=true' in the connection string.".FormatInvariant(parameterName));
5959
}
6060

6161
protected override void OnPositionalParameter(int index)

0 commit comments

Comments
 (0)