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.
 
Only the "f1" field. And I want to see the "f1" and "ft" fields....
 
SO is there only one column with f1 or are there two columns and one is
blank?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top