Yep, me again!
I'm building a library program. I've successfully extracted data from an Oracle 9i database and bound the the data to controls. Here the code that establishes my connection and 'Fills' the dataset:
Notice the 'been_read' and 'owner' columns. They return specific values that I need to read in order to set a radio button on my window application. Depending on the values returned by the columns, I activate a radio button. How do I read the values? Should I create a DataTable?
All I really want to do is read the values into variable then use the results in an IF-ELSE statement. How do you read a dataset? I've been surfing the Net attempting to find an example. So far, zilch.
Regards
Mike Parish, Toronto, Canada
I'm building a library program. I've successfully extracted data from an Oracle 9i database and bound the the data to controls. Here the code that establishes my connection and 'Fills' the dataset:
Public Class Form1
Inherits System.Windows.Forms.Form
'Declare Objects
Dim connectStr As String = "Provider=MSDAORA.1; User Id=books;Password=books;Data Source=Library"
Dim con As New OleDbConnection(connectStr)
Dim objA As OleDbDataAdapter = New OleDbDataAdapter( _
"Select firstname, lastname, title, year_pub, details.isbn, details.cost, " & _
"type_of_book, cover_of_book, inout, owner, been_read, " & _
"from authors, details where authors.isbn = details.isbn " & _
"order by lastname", con)
Dim objDataSet As DataSet
Dim objDataView As DataView
Dim objCurrencyManager As CurrencyManager
Private Sub FillDataSetAndView()
'initialize a new instance of the Dataset object...
objDataSet = New DataSet
'fill with DataSet object with data...
objA.Fill(objDataSet, "details")
'set the DataView object to the DataSet object...
objDataView = New DataView(objDataSet.Tables("details"))
'set our CurrencyManager object to the DataView object
objCurrencyManager = CType(Me.BindingContext(objDataView), CurrencyManager)
End Sub
Notice the 'been_read' and 'owner' columns. They return specific values that I need to read in order to set a radio button on my window application. Depending on the values returned by the columns, I activate a radio button. How do I read the values? Should I create a DataTable?
All I really want to do is read the values into variable then use the results in an IF-ELSE statement. How do you read a dataset? I've been surfing the Net attempting to find an example. So far, zilch.
Regards
Mike Parish, Toronto, Canada