How to get a single value(column) from a dataset

HI guys
Please help me, i have a page with a datagrid(gets the values from a dataset). And i have another  dataset from which i want to only display the value of one column from it.
How do i do that in the code behind?

Thank you :chomp:

0
wagae
3/7/2006 11:51:16 AM
asp.net.presentation-controls 72751 articles. 3 followers. Follow

1 Replies
541 Views

Similar Articles

[PageSpeed] 14

Thank you,
i got it
datatable = dataset.Tables(0)
datarow = datatable.Rows(0)
lblLabel1.Text = CStr(datarow("column you want")) 'this is if you want it on a label
0
wagae
3/8/2006 11:04:56 AM
Reply:

Similar Artilces:

How do I extract a single value from a single column in a single row in a dataset?
First of all, thank you to everyone who takes time to answer basic questions in this forum. Your patience is deeply appreciated. For the past day, I've been trying to figure out how to access a single value in a row of a data set. The data layer tutorials by Scott Mitchell are helpful, but I still can't figure out how to extract a single value without looping through the data set. By passing a Client_ID to an instance of my data adapter, I am able to return a unique row that contains a column labeled Family_ID. However, I can't figure out how to access the value of that column on...

How can I get the value of one single column from a DataSet/DataView?
I have a DataSet or DataView that contains a bunch of info. I can filter down to one row using .RowFilter on the DataView. I want to simply populate a label with the string value of column "A" for example. This should be easy, but I am struggling with it. Any suggestions?--[_]-[_]--AGENT_SMITH Well a dataview is going to give a Row of data.... It's up to you to just bind or fetch the single column that you are looking for.... Here is an example of some code that I use to fetch from the ASP.Cache object a readonly dataview.... and use it as the datasource for ...

using javascript getting value from textbox when edit button is clicked and both controls are present in gridview control
Hi All using javascript I want to get value  from textbox when edit button is clicked and both controls that is texbox and button are present in gridview control .Alok Hi aloksinha83, Please see this post: http://forums.asp.net/t/1069245.aspx Thanks,Qin Dian TangMicrosoft Online Community SupportPlease remember to mark the replies as answers if they help and unmark them if they provide no help....

Getting a Single Value From a DataSet
This seems like such a silly question, but I haven't found the answer yet. How do I get a single value from a DataSet? Like, if the DataSet has a table "TableX" which has a field/column "ValueX", then how do I get "ValueX" for a given row? I've only been using DataSets to bind whole columns and stuff thus far. If you are returning a 1x1 result (e.g. SELECT Count(*) FROM Table1), then you should look at using the .ExecuteScalar() method instead of using a DataSet. You can find it on all of the providers (SqlCommand, OleDbCommand). Incidentally, have you ...

Getting value of a single column
Hello Everyone, I am new to this group and Powerbuilder. Therefore, any help would be greatly appreciated. Here is my situation: I have a datawindow (dw_trafficmarkets) and I would like to get the value of the "Mktname" column for all the rows in this datawindow. Can anyone help me? dw_trafficmarkets ************* * Chicago * * New York * * Atlanta * * Etc. * ************* I need to get all the values from the above data window and then use them to select a list of products from a table where the markets equal the markets con...

Choosing between two column values to return as single column value
I'm working on a social network where I store my friend GUIDs in a table with the following structure:user1_guid       user2_guidI am trying to write a query to return a single list of all a users' friends in a single column.  Depending on who initiates the friendship, a users' guid value can be in either of the two columns.  Here is the crazy sql I have come up with to give what I want, but I'm sure there's a better way...  Any ideas?SELECT DISTINCT UserIdFROM espace_ProfilePropertyWHERE (UserId IN ...

Getting column value from a gridview control
I have a grid view control and has one datakey and other columns. In my grid view I have an Edit Control and a Delete Control. 1) When I press Edit control, I am getting datakey value as expected. But I am not getting other column name i.e. pdf_filename 2) when I press Delete control, I should get the datakey value. But I am not getting I am using c#  Please help me Hi vmk, Could you be a littlemore elaborate? like how have you bound your grid? 1.Columns autogenerated 2.Using TemplateFields 3.Using BoundFields.Regards,NaveenPlease remember to click Mark as Answer on the pos...

Get single value from Dataset ??
How can I get a single value from a dataTable in a DataSet. I would like to set a variable like this int companyId = ...value from dataset... method for filling dataset private void fillEmployeeInfo(string empId) { string emplSql = "SELECT forename, surname, title, photo, email, employee_id FROM Employee WHERE employee_id = " + empId; string companySql = "SELECT Company.company_id " + "FROM Company INNER JOIN Employee ON Company.company_id = Employee.company_id " + "WHERE Employee.employee_id = " + e...

Matching each value out of multiple values to single column value
 Hi,  @whoposted in stored procedure holds value "agent  builder owner"  ( please note the space in between) My column  POSTED_BY  always holds one and only one value out of above 3.Example:       POSTED_BY  owneragent          etc... If  All / any of the value hold by  @whoposted matches with value of POSTED_BY column, i want to show that row in gridview.( Also, please note, str may hold different values depending on user selection. For example, it may ...

Get Value from Hidden Column in Gridview control
I have managed to get the value from my hidden field by using the SelectedIndexChanged event and the following line of code:string keyValue = GridView1.SelectedDataKey.Value.ToString()I would however prefer to get access to the hidden column value on the GridView1_RowDataBound event, so that I can then evaluate each row against the hidden columns value and decide whether or not to display the edit button in each row. Can I do this a different way? You can use e.Row.DataItem("field name") in the RowDataBound event -  as long as the field is in your SQL statement doesn't m...

Get the column value from a DataGrid
 Hi,I have a datagrid with 6 columns. I am trying to retrieve the value of a column and pass it to a variable. I am not sure what I doing wrong here since the code I am using is not pulling any value from the column.  This is an example of what I am trying to do. Dim column_value As Stringcolumn_value = DataGrid1.Items(0).Cells.Item(4).Text                        Please correct me if I am wrong.   Thanks.    Use a GridView control instea...

Binding a single column value from a dataset to a label
I have a class that handles my database calls. In that class I have a function that returns a dataset containing a single row with about 12 columns. Examples of columns are first name, last name, ect. I have several lables on the page that I need to bind a single column value such as first name to the lblFirstName control on the page. I have several datasets on the page. How do I excplicitly bind the dataset by name a label? C# or VB.NET code will be fine. Thanks Hi, Here is a sample. Dim ds As New DataSet() ' Code to get value for the dataset ...

How to avoid error getting value from sp when column is not present....
I have a stored procedure that returns some data, however as it is an aggregate function if the data is not present then the columns will not be returned. I am trying to get data out of this dataset and place it into labels on a page however i get the following error: lblAwaitingPosession.Text = miAmountSet.Tables[0].Rows[0]["Total Amount"].ToString(); Column 'Total Amount' does not belong to table Table.  How do I check for the existence of a column before accessing it so that I dont run into this problem? Any help much appreciated...Regards, PeterPeter Heard ...

How do you get a column value from a gridview column
How do you get a column value from a gridview column in asp.net 3.5? I tried this but it does not work.Dim myRow As GridViewRowFor Each myRow In GridView1.Rows    Dim strTest As String = DataBinder.Eval(myRow.DataItem, "EmailSubject")Nextif I change the column to a Template field then EmailSubject = myRow.FindControl("EmailSubject") works but I was hoping for a more direct way of getting a column value EmailSubject = myRow.Cells(4).Text also works but is not flexible if I change the column orderThanks Craig Try: Dim strTest As String = CType(...

Web resources about - How to get a single value(column) from a dataset - asp.net.presentation-controls

UAH satellite temperature dataset - Wikipedia, the free encyclopedia
The UAH satellite temperature dataset , developed at the University of Alabama in Huntsville , attempts to infer the temperature of the atmosphere ...

Data : Where can I get large datasets open to the public?
Answer (1 of 91): Here's the ones I've found most useful: CrunchBase, US Census, Google Public Data, Infochimps, Timetric, Factual, Freebase, ...

YouTube - Hans Rosling: Let my dataset change your mindset
Hochgeladen am 31.08.2009 http://www.ted.com Talking at the US State Department this summer, Hans Rosling uses his fascinating data-bubble software ...

The Mindset, Skillset, Dataset Approach to Social Media
... Social media is comprised primarily of unstructured data, which is difficult to analyze. A new approach called Mindset, Skillset, Dataset can ...

Sending large datasets to Amazon? Use the Post Office
Amazon has introduced a new method to move large amounts of data to and from …

Yahoo Releases the Largest-ever Machine Learning Dataset for Researchers
Yahoo is announcing the public release of the largest-ever machine learning dataset to the research community.

IDG Contributor Network: Are datasets truly anonymized? Two well-suited researchers are going to find ...
With little fanfare or formality, Adam Smith , associate professor of computer science and engineering in Penn State's School of Electrical Engineering ...

House GOP looks to shed light on EPA secret datasets
House Republicans have introduced a bill that would block the Environmental Protection Agency from crafting regulations based on “secret” scientific ...

Google Making It Easier to Transfer Huge Datasets on the Cloud
... Cloud Import services are now in preview mode, but could later be available on a widespread basis to help enterprises move their large datasets ...

Environmental datasets, reverse auction legislation and military email
News and notes from around the federal IT community. The White House's Data.gov has added five datasets to the Ecosystem Vulnerability theme ...

Resources last updated: 1/22/2016 6:14:12 AM