Ok ok ho risolto sotto suggerimento..
tnx
codice:
class prova MySql
{
public static void Main() {
MySqlConnection conn = null;
MySqlCommand res = null;
MySqlDataReader dr = null;
try {
conn = new MySqlConnection( new MySqlConnectionString("127.0.01", "sitostandard", "root", "", 1000).AsString) );
}
catch( MySqlException ex ) {
Console.WriteLine( "Errore connessione" );
}
try {
res = new MySqlCommand( "SELECT * FROM Categorie Where id_parent = 0", conn );
dr = res.ExecuteReaderEx();
}
catch( MySqlException ex ) {
Console.WriteLine( "Errore nella query" );
}
while( dr.Read() ) {
Console.WriteLine( "Nome categoria: " + dr[2].ToString() );
}
dr = null;
res.Dispose(); res = null;
conn.Close; conn = null;
}
}