Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Newbie question on dataview
Message
From
11/09/2005 18:14:36
 
General information
Forum:
ASP.NET
Category:
ADO.NET
Miscellaneous
Thread ID:
01048552
Message ID:
01048563
Views:
15
This message has been marked as the solution to the initial question of the thread.
Dmitry,

OK, so you have the index based on the index from whatever was selected from the dropdownlist. It will be the index to whatever is bound to it, which in your case is a DataView. So, to access your column (in my example, a string column) you simply use this syntax:
string MyValue = MyDataView[iIndex]["MyColumn"].ToString();
Does this help?

~~Bonnie



>Bonnie,
>
>Let me explain a bit differently. I have a dropdownlist bound to a dataview. The dataview has 3 columns. When user selects an item from a dropdownlist I want to know the value in some column of the dataview. And I don't know how to reference a dataview by row number and column name. Am I more clear now?
>
>Thank you.
>
>>Dmitry,
>>
>>I guess I'm not sure what it is you're looking for. You already have an index? For the DataTable or the DataView?
>>
>>Could you elaborate a bit more on what you're trying to accomplish or explain your question in a different way?
>>
>>~~Bonnie
>>
>>
>>
>>
>>>How do I get a value for an iIndex row of a dataview? For example,
>>>suppose I define a dataview like this:
>>>
>>>
>>>DataView MyDataView = new DataView( MyDataSet.Tables["MyTable"]);
>>>
>>>
>>>Then I want to get the value of column "MyColumn" in the row iIndex in the dataview MyDataView. How do I do it? What is the syntax?
>>>
>>>Thank you.
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform