A
Aymer
Scenario: I have a datagrid object and a command object
in code-behind module.
dgFilings As DataGrid
Dim oCmd As SqlCommand
I have a function that I can re-use to bind different
objects.
Sub O_DataBind(oControl As Object, oCommand As SqlCommand)
Dim oAdapter As SqlDataAdapter
Dim oDataSet As DataSet
oAdapter = New SqlDataAdapter(oCommand)
oDataSet = New DataSet()
oAdapter.Fill(oDataSet)
oControl.DataSource = oDataSet
oControl.DataBind()
End Sub
So, I would pass in the datagrid object and a command
object into the function.
O_DataBind(dgFilings, oCmd)
I have "Option Strict True" turn on in my code-module.
Problem: Apparently, what i am doing is illegal under the
option strict rule. The error that it gives me
is: "BC30574: Option Strict On disallows late binding"
on line 123.
Line 121: oAdapter.Fill(oDataSet)
Line 122:
Line 123: oControl.DataSource = oDataSet
Line 124: oControl.DataBind()
How do i go around this dilemma? There has to be a
solution.
thanxs in advance,
aymer
aymerb[@].yahoo.com
in code-behind module.
dgFilings As DataGrid
Dim oCmd As SqlCommand
I have a function that I can re-use to bind different
objects.
Sub O_DataBind(oControl As Object, oCommand As SqlCommand)
Dim oAdapter As SqlDataAdapter
Dim oDataSet As DataSet
oAdapter = New SqlDataAdapter(oCommand)
oDataSet = New DataSet()
oAdapter.Fill(oDataSet)
oControl.DataSource = oDataSet
oControl.DataBind()
End Sub
So, I would pass in the datagrid object and a command
object into the function.
O_DataBind(dgFilings, oCmd)
I have "Option Strict True" turn on in my code-module.
Problem: Apparently, what i am doing is illegal under the
option strict rule. The error that it gives me
is: "BC30574: Option Strict On disallows late binding"
on line 123.
Line 121: oAdapter.Fill(oDataSet)
Line 122:
Line 123: oControl.DataSource = oDataSet
Line 124: oControl.DataBind()
How do i go around this dilemma? There has to be a
solution.
thanxs in advance,
aymer
aymerb[@].yahoo.com