Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- MySqlCommand getCharacterCommand = new MySqlCommand("SELECT * FROM `chars` WHERE `name` LIKE ?name", this.conn);
- getCharacterCommand.Parameters.AddWithValue("?name", "%"+ characterName +"%");
- MySqlDataReader getCharacterReader = getCharacterCommand.ExecuteReader();
- if ( getCharacterReader.Read() ) {
- for ( int i = 0; i < getCharacterReader.FieldCount; i++ ) {
- // do something here
- }
- } else {
- // error - no result
- }
Add Comment
Please, Sign In to add comment