I'm trying to cast value from database to local variable. The value and the local variable are with the same type (both string), but it seems i can't work it through. If i add .toString()
it looks fine (didn't test but no errors). I checked Faqs and some youtube videos and there was no problem and they use same method of casting. The code below gives me this error:
Error CS0266 Cannot implicitly convert type 'object' to 'string'. An explicit conversion exists (are you missing a cast?)
Additional informations: using Adodb v7.0.3300.0, Visualstudio 2017 C#.
var db = Globals.mysql.DB_RS;
db.Open("SELECT * FROM accounts WHERE username='"+user+"'", Globals.mysql.DB_CONN, ADODB.CursorTypeEnum.adOpenStatic, ADODB.LockTypeEnum.adLockOptimistic);
Globals.player[index].username = db.Fields["username"].Value;