Hi,
I'm trying to work with parameters in my mysqlqueryies... but I guess I'm doing something wrong cause I don't get any output..
works fine:
doesn't work:
I have no clue what I did wrong... Or perhaps those parameters only work with I, U, D ?
I'm trying to work with parameters in my mysqlqueryies... but I guess I'm doing something wrong cause I don't get any output..
works fine:
string strQryGetPlayerConn = "SELECT * " +
"FROM ws_insim_users " +
"WHERE username = '" + playerConn.Username + "';";
MySqlCommand qryGetPlayerConn = mysqlConn.CreateCommand();
qryGetPlayerConn.CommandText = strQryGetPlayerConn;
MySqlDataReader reader = qryGetPlayerConn.ExecuteReader();
doesn't work:
string strQryGetPlayerConn = "SELECT * " +
"FROM ws_insim_users " +
"WHERE username = @UserName;";
MySqlCommand qryGetPlayerConn = mysqlConn.CreateCommand();
qryGetPlayerConn.CommandText = strQryGetPlayerConn;
qryGetPlayerConn.Parameters.Add("@UserName", MySqlDbType.String);
qryGetPlayerConn.Parameters["@UserName"].Value = playerConn.Username;
MySqlDataReader reader = qryGetPlayerConn.ExecuteReader();
I have no clue what I did wrong... Or perhaps those parameters only work with I, U, D ?