R
Roger
All,
I am having a difficult time understanding how we can define columns in a
datagrid when we assign the data vai recordsource.
I have entered the properties of the Grid, and added a tableStyle. In this
style I have added same number of columns that are in
the return of the SQL statement below. I don't see these setting showing up
(I.E) I have changed the columnn names and don't
see these changes.
I also would like to see the full date and time not just the date and don't
know how to make this happen.
Here is the code.
Dim sSql As String
Dim cn As New SqlClient.SqlConnection("Initial Catalog=tmsystem;Data
Source=echo;Integrated Security=SSPI")
sSql = "SELECT DISTINCT tmQueue.dbo.machines.MachineName as Machine,
MAX(siteimports.Requested) AS [Last Process Date]" & _
" FROM tmQueue.dbo.machines INNER JOIN siteimports ON
tmQueue.dbo.machines.MachineKey = siteimports.ImportMachine" & _
" GROUP BY tmQueue.dbo.machines.MachineName"
Dim siteda As SqlDataAdapter = New SqlDataAdapter(sSql, cn)
Dim ds As New DataSet
siteda.Fill(ds, "Roger")
dgProcessingMachines.SetDataBinding(ds, "Roger")
Thanks,
Rog
I am having a difficult time understanding how we can define columns in a
datagrid when we assign the data vai recordsource.
I have entered the properties of the Grid, and added a tableStyle. In this
style I have added same number of columns that are in
the return of the SQL statement below. I don't see these setting showing up
(I.E) I have changed the columnn names and don't
see these changes.
I also would like to see the full date and time not just the date and don't
know how to make this happen.
Here is the code.
Dim sSql As String
Dim cn As New SqlClient.SqlConnection("Initial Catalog=tmsystem;Data
Source=echo;Integrated Security=SSPI")
sSql = "SELECT DISTINCT tmQueue.dbo.machines.MachineName as Machine,
MAX(siteimports.Requested) AS [Last Process Date]" & _
" FROM tmQueue.dbo.machines INNER JOIN siteimports ON
tmQueue.dbo.machines.MachineKey = siteimports.ImportMachine" & _
" GROUP BY tmQueue.dbo.machines.MachineName"
Dim siteda As SqlDataAdapter = New SqlDataAdapter(sSql, cn)
Dim ds As New DataSet
siteda.Fill(ds, "Roger")
dgProcessingMachines.SetDataBinding(ds, "Roger")
Thanks,
Rog