Can someone tell me how I get around the following error?
I keep getting the following error on the "RETURN ddlDataSet" line of my
code! I don't know how to get arround this and would be grateful for any
advice people may have to offer!
Thanks..
...::Error
value of type 'System.Data.DataSet' cannot be converted to 'Interger'
...:: CODE
Function GetSelectedIndex(ByVal OID As String) As Integer
'Populate the ddlDataSet
Dim Myconn As New SqlConnection(ConfigurationSettings.AppSettings("s trConn"))
Dim myDataAdapter As SqlDataAdapter = New SqlDataAdapter("SelectOffice",
Myconn)
myDataAdapter.Fill(ddlDataSet, "Offices")
Return ddlDataSet
Dim iLoop As Integer
Dim dt As DataTable = ddlDataSet.Tables("Offices")
For iLoop = 0 To dt.Rows.Count - 1
If Int32.Parse(OID) = Int32.Parse(dt.Rows(iLoop)("officeID")) Then
Return iLoop
End If
Next iLoop
End Function