[RESOLVED] Dataset - datatable
Hi, I have a dataset and inside it a dataTable. How can I retrieve the data of the datatable?
My code is this:
objDataAdapter.SelectCommand = New SqlCommand()
objDataAdapter.SelectCommand.Connection = objConnection
objDataAdapter.SelectCommand.CommandText = _
"SELECT distinct Title FROM Outlookbar "
objDataAdapter.SelectCommand.CommandType = CommandType.Text
objConnection.Open()
' Fill the DataSet object with data...
objDataAdapter.Fill(objDataSet, "Outlookbar")
............
I think that untill here I have created a Dataset with a dataTable that has the name Outlookbar. In my example the sql query must return 4 rows(4 data from the table of the database).
So, how can I store its one of these rows (of the dataTable) in a variable for later use?
Re: [RESOLVED] Dataset - datatable
I guess the only thing to keep in mind would be that string comparisons are less efficient than ordinal based lookups - so if you had a large amount of data you would probably want to use ordinals (like for accessing rows, etc.) - you can always use an enum or something to get the name / value pairs to still be able to go by a name but actually use the value - if that makes sense.