You didn’t connect your SqlConnection
and SqlCommand
.
Just define your connection as a second parameter like;
SqlCommand CheckExp = new SqlCommand("SELECT Experience FROM Player WHERE UserID=@uid", connection);
Or you can assing your SqlCommand.Connection
property like;
CheckExp.Connection = connection;
4
solved ExecuteReader: Connection property has not been initialized. Browser Game [closed]