About DataGrid and SUM

  • Thread starter Thread starter Alberto
  • Start date Start date
A

Alberto

Hi,

I have this code to fill a DataGrid:


Dim dt As New DataTable

SQL = "SELECT f1, SUM(f2) AS ft FROM table GROUP BY f1"

Dim adp As New System.Data.SqlServerCe.SqlCeDataAdapter(SQL, sqlConn)

dt.Clear()
adp.Fill(dt)
Grid.Visible = False
Grid.DataSource = dt
Grid.Visible = True

But this not display the "ft" field in my Grid. Wy??

Tx in advance.
 
SO is there only one column with f1 or are there two columns and one is
blank?
 
Back
Top