How to access data through the objectdatasource in ASP.NET 2.0 code behind?

calvin

Regular
Joined
Nov 6, 2003
Messages
71
Hi,

I have create number of Dataset which in App_code. I know how to use the table adapter to connect database and command in design page. But I need to get the data from dataset in codebehind.

This is a real example I need to solve:

In my database table, I need to access three column of data to analyze it and get the output I want. For example, the column1 is phone1, column2 is phone2 and column3 is phone3. So in my sql query, I do like this

sql = "Select phone1, phone2, phone3 from mytable"

Because I need to get this 3 column of data to put in my logic to get the output I want. Once the logic decide which column to use, then another logic will filtering the data and get the final out. For example, once decide to use column1 data, the data contain a long string, But I just need some of the character/string only.

My problem is, how can I use the dataset which store in app_code to access the data and put in my logic.

In asp.net 1.1, I can do like this :

Dim ds as dataset
.
.
.
Dim getData As String = ds.Tables(0).Rows(s).Item("Phone1")

If getData = ... Then
....
End If

In asp.net 2.0
?

Any solution and references are appreciated.

Calvin
 
Back
Top