You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
varconnectionString="Server=127.0.0.1;User ID=root;Password=123456;Database=test;Allow User Variables=False";usingvarconnection=newMySql.Data.MySqlClient.MySqlConnection(connectionString);varsql=@"SELECT 1 INTO @`a`; SELECT @`a`;";try{inta=awaitconnection.QuerySingleOrDefaultAsync<int>(sql);Console.WriteLine($"a: {a}");}catch(Exceptionex){Console.WriteLine(ex.Message);}
Output:
a: 1
Describe the solution you'd like
Do this in a similar way.
Additional context
I like to use Allow User Variables=False to avoid typos, but I need a way to use variables in special cases.