Click here to Skip to main content
15,891,981 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello

i fill my dataset(DataAdapter method) with query like

select customerid,Customername,job from customers(query from microsoft sql server Database)

how do i get field value like Customername for CurrentRow
directly from dataset without using DataRow Class (Saytem.Data.DataRow)

Thanks
Posted

1 solution

You can index directly to the elements of the dataset. The dataset contains a table and the table contains rows.

dataset.Tables.Item(0).Rows.Item(rowindex).Item("name of column")

Using a DataRow makes it simpler is all so why not.
 
Share this answer
 
Comments
daneshmand1354 28-Jan-16 13:30pm    
thanks

if we have a dataGridView (connected to dataset) and a Textbox on Form
what is simplest way to show one string filed of data on textbox

so that

if we move up and down on DatagridView
TextBox update from dataset

or

has c# a control like DataTextBox to connect to dataset ?
Michael_Davies 29-Jan-16 4:44am    
You need to trap the selection event on the gridview and respond accordingly, lots of examples if you Google.
daneshmand1354 31-Jan-16 12:55pm    
thank you very much

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900