Hello All
I'm using the following code to get data into my datagird and it takes about 7-8 seconds to load 10 rows. Am I doing something wrong? Can I speed this up somehow

cn = New System.Data.SqlServerCe.SqlCeConnection("Data Source=\Program Files\first_app\star_mobile.sdf"
DataGrid1.RowHeadersVisible = Fals
Dim myCommand As New System.Data.SqlServerCe.SqlCeCommand("SELECT * FROM SM_DEMO ORDER BY
LAST_NAME", cn
myCommand.CommandType = CommandType.Tex
Dim myAdapter As New System.Data.SqlServerCe.SqlCeDataAdapte
myAdapter.SelectCommand = myComman
Dim ds As New DataSe
myAdapter.Fill(ds, "SM_DEMO"
DataGrid1.DataSource = ds.Tables("SM_DEMO").DefaultView(

Thanks for your input ;

RE: Slow data retrieval by anonymous

anonymous
Fri Feb 20 16:01:10 CST 2004

You could isolate the query part and the fill part. Try to analyse whether query is taking much time
Order by query takes time as the engine has to select and then sort the rows.
Try optimizing the query -
If you do not have to select all the columns, specify the specific columns you want. don't do select
try putting index on last nam

If it doesn't help, then your data fill code is taking time.