Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / October 2007

Tip: Looking for answers? Try searching our database.

Reading single field values from a dataset

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bjorn Sagbakken - 07 Oct 2007 18:42 GMT
What is the best way to read single field values from a dataset? The dataset
is populated with a customer record, showing well in a gridview. But I also
want to read the single field values, like adress, phone, and so on.

Bjorn
Alexey Smirnov - 07 Oct 2007 19:17 GMT
> What is the best way to read single field values from a dataset? The dataset
> is populated with a customer record, showing well in a gridview. But I also
> want to read the single field values, like adress, phone, and so on.
>
> Bjorn

for example, myDataSet.Tables[0].Rows[0][0]

it gives you a value of the first colum in the first row
Bjorn Sagbakken - 07 Oct 2007 19:30 GMT
>> What is the best way to read single field values from a dataset? The
>> dataset
[quoted text clipped - 7 lines]
>
> it gives you a value of the first colum in the first row

Thanks a lot. That was exactly what I was looking for.

Bjørn
sloan - 08 Oct 2007 19:08 GMT
Is it a strong or weak typed DataSet?

Let's say you have
EmployeeDS
with one table : Employee
and 3 columns
EmployeeID (int) , LastName (string) , FirstName (string)

Here is some pseudo code:

EmployeeDS ds = new EmployeeDS();

ds.Employee.AddNewEmployeeRow ( 101, "Smith" , "John") ;

........

EmployeeDS.EmployeeRow row = ds.Employee.Rows[0] as EmployeeDS.EmployeeRow;
// friendly cast
if(null!=row)
{
int empid = row.EmployeeID;
}

> What is the best way to read single field values from a dataset? The
> dataset is populated with a customer record, showing well in a gridview.
> But I also want to read the single field values, like adress, phone, and
> so on.
>
> Bjorn

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.