Being new to the EO.web product I cannot understand where I am going wrong. I have built a grid, created the column headers, and used a simple select statement to get data from an existing SQL db just to get a feel for the grid product. The grid appears with the column headers and the correct amount of lines returned by the sql select. However, no data is in the cells. I have used multiple versions of code to select the data and doing the databind. Same results. No errors just no data in the grid. I have also validated by other code that reads the returned dataset that data is present.
The code here represents the sql and databind.
Where am I going wrong here?
Thank you for any help. Mike
Code: Visual Basic.NET
Version 1:
Dim SQLStatement As String = "SELECT TOP(3) * FROM cotts.dbo.tbltimecard" ' where empid = '999222' " (used to generate no data)
Dim con = New SqlConnection(MyConnection)
Dim cmd = New SqlCommand(SQLStatement, con)
cmd.CommandType = CommandType.Text
con.Open()
Grid1.DataSource = cmd.ExecuteReader()
Grid1.DataBind()
con.Close()
con.Dispose()
Version 2:
Dim SQLStatement As String = "SELECT TOP(3) * FROM cotts.dbo.tbltimecard" ' where empid = '999222' "
Dim myCmd As SqlDataAdapter = New SqlDataAdapter(SQLStatement, NewConnection)
Dim mydata As New DataTable
myCmd.Fill(mydata)
Grid1.DataSource = mydata
Grid1.DataBind()