Hi everyone,

I've currently got a C# application running, using a mySQL database. I've managed to be able to open, read and display the database and query it too. What I want to be able to do is query the database for a username, and if it does not exist, return "false", or say have a "rows returned" integer. This is so that I can call other functions depending on the results returned. I'd like it to work something like this:

Code:
string searchData = "SELECT * FROM player_info WHERE idname =  @idname";
MySqlCommand myCommand = new MySqlCommand(searchData);
myCommand.Parameters.Add("?idname", MySqlDbType.VarChar, 20, data);

//--and then depending on if the name exists, call other functions:

if(rowsReturned == 0)
{ 
    addusernametoDB();
}
else
{
   dosomethingelse();
}

I hope this makes sense to someone - I've been racking my brains for days on this and I've made not a bit of progress.

Thanks in advance