I'm using the following to grab a SINGLE record from a remote database (SQL SERVER 2000) based on a primary key. I am trying to pass that datarow to a subroutine that will combine some columns from that row and some locally generated information into a local database. The INSERT command is in the subroutine 'InsertToCue' "r" is a datarow from a local datatable that will be combined with the row from the remote DB.
How do I pass the entire row obtained from the sqldatareader to a sub and then reference the wanted columns by their names like "theRow("LastName")" instead of by index/column number?
Here is partial code:
'Use remote DB
myCommand = New SqlCommand(sql, Connection)
Dim sqlReader As SqlDataReader = myCommand.ExecuteReader()
Dim theRow() As DataRow = Nothing
'For j = 0 To 20 'This was testing to make sure right row matched r
Thanks for your thoughts