You have to do something with what you are reading, place it in a variable for later usage, or output it directly, for example.
if (mySqlDataReader.HasRows)
{
mySqlDataReader.Read();
string value = ((IDataRecord)mySqlDataReader)[0];
}
else
{
}
Edit: here's something which you could try (avoiding using
AddWithValue()
method to specify the parameter type explicitly):
mySqlCommand.Parameters.Add("@imei", SqlDbType.NVarChar).Value = imei;
Moreover, there is a flaw in your stored procedure: you are not using the imei parameter to select the database name; therefore, the selected database name is static (since based on the static value 869170031585095), whereas the second query is using the parameter.
SELECT @DatabaseName= DboName from [CentralRelation].[dbo].[TrackingMaster] WHERE Imei = @imei;