c# - AND statement in mySQL -
this question has reply here:
what nullreferenceexception , how prepare it? 21 answersi'm trying run query in mysql database c#. want column prioritysettings returned when 3 previous columns within values. query works, 1 variable @ time, @ moment can specify value of 1 of columns. and
statements correct?
string query = "select prioritysetting {database} handling ='" + handling + "'" + "and corner ='" + corner + "'" + "and powerfulness ='" + powerfulness + "'";
some more code;
mysqldatareader sqlreader; string handling = overorunderinput; string corner = cornerpartinput; string powerfulness = onoroffpowerinput; string query = "select prioritysetting {database} handling ='" + handling + "'" + " , corner ='" + corner + "'" + " , powerfulness ='" + powerfulness + "'"; mysqlcommand getrecords = new mysqlcommand(query, connection); connection.open(); sqlreader = getrecords.executereader(); while (sqlreader.read()) { seek { seek { suggestions[i] = (sqlreader.getstring(0)); } grab { } i++; } grab (mysqlexception ex) { messagebox.show(ex.tostring()); }
and error;
system.nullreferenceexception: object reference not set instance of object.
seem space required before each and
.
c# mysql
No comments:
Post a Comment