O
Owen Mortensen
(This code was working in asp.net 1.1 VS2003. After upgrade to VS2005,
chokes):
in the aspx file:
<ItemTemplate>
<asp:datagrid id="dg_instr" runat="server" AutoGenerateColumns="False"
HeaderStyle-Font-Bold="True"
CellPadding="0" CellSpacing="1" Font-Size="Small" BackColor="Transparent"
ForeColor="Black"
BorderStyle="None" BorderColor="#CCCCFF"
DataSource=<%# buildInstrumentListDataGrid(container.dataitem("CatID"))%>>
I get the error: Option Strict On disallows late binding
What item is being late-bound? And how do I not late-bind it?
Here's the function:
Function buildInstrumentListDataGrid(ByVal CatID As String) As DataTable
Dim lp_survey_Connect As New dBUtils("sConnectLPSurvey")
Dim strInstrSQLQuery As String
Dim objInstrDataSet As New DataSet
strInstrSQLQuery = "SELECT InstID, InstName, CatID" & _
" FROM InstrumentList" & _
" WHERE CatID = " & CatID & " ORDER BY InstID"
objInstrDataSet = lp_survey_Connect.GetDataSet(strInstrSQLQuery, False)
lp_survey_Connect.Dispose()
Return objInstrDataSet.Tables(0)
End Function
Thanks,
chokes):
in the aspx file:
<ItemTemplate>
<asp:datagrid id="dg_instr" runat="server" AutoGenerateColumns="False"
HeaderStyle-Font-Bold="True"
CellPadding="0" CellSpacing="1" Font-Size="Small" BackColor="Transparent"
ForeColor="Black"
BorderStyle="None" BorderColor="#CCCCFF"
DataSource=<%# buildInstrumentListDataGrid(container.dataitem("CatID"))%>>
I get the error: Option Strict On disallows late binding
What item is being late-bound? And how do I not late-bind it?
Here's the function:
Function buildInstrumentListDataGrid(ByVal CatID As String) As DataTable
Dim lp_survey_Connect As New dBUtils("sConnectLPSurvey")
Dim strInstrSQLQuery As String
Dim objInstrDataSet As New DataSet
strInstrSQLQuery = "SELECT InstID, InstName, CatID" & _
" FROM InstrumentList" & _
" WHERE CatID = " & CatID & " ORDER BY InstID"
objInstrDataSet = lp_survey_Connect.GetDataSet(strInstrSQLQuery, False)
lp_survey_Connect.Dispose()
Return objInstrDataSet.Tables(0)
End Function
Thanks,