|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Accessing a particular datafield from a dataset
I wanted to access a particular datafield from the dataset i recieve as a result of executing a stored procedure on SQL server. I tried using dataset.tables().rows(), but cant figure out how exactly to work with it.
How can i access a datafield without using XML ( some solutions which i read earlier had read data from a field using XML ) |
|
#2
|
||||
|
||||
|
You are on the right track
dataset.tables(table_index_or_name).rows(index).it em(item_index_or_name) the indicies can either be intergers or fully qualified names, the row will be an interger like dataset.tables("table_name").rows(0).item("column_name") |
|
#3
|
|||
|
|||
|
i used this code 'textbox1.text = order.Tables("orders").Rows(0).Item("orderId")' where 'order' is the dataset and 'orders' is the table and the column i want to access is the 'orderId'. It shows an error "Object reference not set to an instance of an object", though the table is poplulated.
|
|
#4
|
||||
|
||||
|
Please post your code.
Quote:
|
|
#5
|
|||
|
|||
|
I found out the problem. Actually, instead of the 'tablename' in tables i had to type '0'. dataset.tables(0).row(0).item("itemName") works fine.
|
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > Accessing a particular datafield from a dataset |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|