D
Dave
I'm tearing my hair out over this one. I have a newbie's grasp of data
grids in vb.net, i.e. I have successfully taken working code, and made it
work on my applications. I am unsuccessful at this one, however - I am
trying to use a temporary table to load a grid. I do not get any errors
running my code, I just don't get the data grid to appear on my web form.
I'm using SQL Server 2000 and Visual Studio 2003. The query you see
collects 499 records when I run it in Query Analyzer.
Can somebody tell me if they see any obvious errors in my code - syntactic
or conceptual? Thanks very much in advance.
Dave
Function MyFunction() as Boolean
Dim sql As String = "SELECT Observation, Issue, Description "
sql &= "INTO #tmpMultipleTableAggregate "
sql &= "FROM tblLkpAssociatedIssues [L], tblIssueMaster "
sql &= "WHERE L.Issue = i.IssueNumber "
sql &= "ORDER BY Observation, L.Issue "
Dim con As New SqlConnection(sConnect) 'sConnect is a global constant
Dim cmd As New SqlCommand(sql, con)
Dim adapter As New SqlDataAdapter(cmd)
Dim dsIssueTracking As New DataSet
con.Open()
adapter.Fill(dsIssueTracking, "#tmpMultipleTableAggregate")
con.Close()
'Load the data grid with the temporary table culled from two other tables
grdLink.DataSource = dsIssueTracking.Tables("#tmpMultipleTableAggregate")
grdLink.Enabled = True
grdLink.Visible = True
grdLink.DataBind()
End Function
grids in vb.net, i.e. I have successfully taken working code, and made it
work on my applications. I am unsuccessful at this one, however - I am
trying to use a temporary table to load a grid. I do not get any errors
running my code, I just don't get the data grid to appear on my web form.
I'm using SQL Server 2000 and Visual Studio 2003. The query you see
collects 499 records when I run it in Query Analyzer.
Can somebody tell me if they see any obvious errors in my code - syntactic
or conceptual? Thanks very much in advance.
Dave
Function MyFunction() as Boolean
Dim sql As String = "SELECT Observation, Issue, Description "
sql &= "INTO #tmpMultipleTableAggregate "
sql &= "FROM tblLkpAssociatedIssues [L], tblIssueMaster "
sql &= "WHERE L.Issue = i.IssueNumber "
sql &= "ORDER BY Observation, L.Issue "
Dim con As New SqlConnection(sConnect) 'sConnect is a global constant
Dim cmd As New SqlCommand(sql, con)
Dim adapter As New SqlDataAdapter(cmd)
Dim dsIssueTracking As New DataSet
con.Open()
adapter.Fill(dsIssueTracking, "#tmpMultipleTableAggregate")
con.Close()
'Load the data grid with the temporary table culled from two other tables
grdLink.DataSource = dsIssueTracking.Tables("#tmpMultipleTableAggregate")
grdLink.Enabled = True
grdLink.Visible = True
grdLink.DataBind()
End Function