ciao a tutti!
volevo chiedervi un aiuto perchè ultimamente ho "scoperto" che utilizzando il seguente codice
quando eseguo DataAdapter.Fill(table) l'applicazione sembra rallentare inesorabilmente.codice:Dim table As New DataTable() Try ' The SqlConnection class allows you to communicate ' with SQL Server and DataTable. ' A SqlCommand object is used to execute the SQL commands. Dim mycmd As New MySqlCommand(querymysql, conn) Dim DataAdapter As New MySqlDataAdapter(mycmd) Dim commandBuilder As New MySqlCommandBuilder(DataAdapter) ' The SqlDataAdapter is responsible for using ' a SqlCommand object to fill a DataSet. DataAdapter.Fill(table) ' Set the DataGrid caption, bind it to the DataSet, ' and then make it Visible Catch sqlExc As MySqlException MessageBox.Show(sqlExc.ToString, "SQL Exception Error!", _ MessageBoxButtons.OK, MessageBoxIcon.Error) End Try datagrid1.datasource = table
la query mysql è una semplice select di una 30ina di righe.
Il db risponde in maniera fulminea (anche perchè è in locale).
avete suggerimenti?

Rispondi quotando