G
greg
I'm trying to set a group of radio buttons based on the
value of a text field in a dataset. This is my code:
Dim ds As DataSet
ds = dtsVideo
Dim dt As DataTable = ds.Tables
("tblPeramItems")
Dim dr As DataRow = dt.Rows(0) 'first row in
datatable
If dr("strStockGroup") = "DVD" Then
rdbDVD.Checked = True
ElseIf dr("strStockGroup") = "Video" Then
rdbVideo.Checked = True
ElseIf dr("strStockGroup") = "Computer Game"
Then
rdbComputerGame.Checked = True
End If
This works as long as I have "Option Strict" set
to "Off". Otherwise i get the error "Option strict on
disallows operands of type object for operator '='.
Use the 'Is' operator to test for object Identity"
Unfortunately I am required to have "Option Strict" set
to "ON". Any ideas on how I can make this work?
Greg
value of a text field in a dataset. This is my code:
Dim ds As DataSet
ds = dtsVideo
Dim dt As DataTable = ds.Tables
("tblPeramItems")
Dim dr As DataRow = dt.Rows(0) 'first row in
datatable
If dr("strStockGroup") = "DVD" Then
rdbDVD.Checked = True
ElseIf dr("strStockGroup") = "Video" Then
rdbVideo.Checked = True
ElseIf dr("strStockGroup") = "Computer Game"
Then
rdbComputerGame.Checked = True
End If
This works as long as I have "Option Strict" set
to "Off". Otherwise i get the error "Option strict on
disallows operands of type object for operator '='.
Use the 'Is' operator to test for object Identity"
Unfortunately I am required to have "Option Strict" set
to "ON". Any ideas on how I can make this work?
Greg