Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > ADO.NET
|
ADO.NET For discussion about ADO.NET.  Topics such as question regarding the System.Data namespace are appropriate.  Questions specific to a particular application should be posted in a forum specific to the application .
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ADO.NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 7th, 2007, 10:09 PM
Registered User
 
Join Date: Feb 2007
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default Need help understanding DataRow


I have:

command.CommandText = “SELECT UserName from Users WHERE UserID = “ = userID

Executing this command returns one table with one column with one row. What is the syntax for getting that value into a variable? I can get the information into a dataSet but I can’t get it out. Should I be using a dataSet for this operation?

The rest of the code so far:

SqlDataAdapter dataAdapter = new SqlDataAdapter();
            dataAdapter.SelectCommand = command;
            dataAdapter.TableMappings.Add("Table", "Users");

            dataSet = new DataSet();
            dataAdapter.Fill(dataSet);


 
Old February 8th, 2007, 11:43 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Something like this:

dataSet.Tables(0).Rows(0).Columns(0)

-Peter
 
Old March 12th, 2007, 05:23 AM
Registered User
 
Join Date: Mar 2007
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Dhanapal
Default


dataset.Tables(0).Rows(0).Columns(0)

i need this coding in C# Language.........
 
Old March 13th, 2007, 02:39 PM
Registered User
 
Join Date: Feb 2007
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default


In C#:

dataSet.Tables[0].Rows[0][0]






Similar Threads
Thread Thread Starter Forum Replies Last Post
DataRow.ItemArray abhi123 C# 4 June 7th, 2007 02:33 PM
insert datarow into datagrid lpl General .NET 1 March 29th, 2006 07:05 AM
how to add a dataRow[] into a datatable sendtogary VS.NET 2002/2003 0 March 27th, 2006 05:32 AM
deleting a datarow sand133 VB Databases Basics 0 July 14th, 2004 07:08 AM
DataRow Or Class Object? RM82 BOOK: ASP.NET Website Programming Problem-Design-Solution 3 June 11th, 2004 09:12 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.