.NETGURU
How would I get a first value from this dataset?
Messages   Related Types
This message was discovered on ASPFriends.com 'ngfx-oledb' list.


Greg Quinn
-- Moved from [aspngcommunity] to [ngfx-oledb] by Charles M. Carroll <Click here to reveal e-mail address> --

In the code below, I have bound the results of myCommand to a DataGrid
called myList. How would I extract the value of the first emailID returned
in the same query? I could yuse another query such as SELECT Top 1 EmailID
from Email, but I am terying to avoid 2 queries... Any suggestions.. Here is
my code...

MyCommand = New OleDbDataAdapter("Select emailID, theFrom, theSubject,
receivedDate, isRead From Email Where Location = 'Inbox'", myConnection)

DS = new DataSet()
MyCommand.Fill(DS, "Email")

Dim messageID as String
messageID = request.querystring("messageID")

MyList.DataSource = DS.Tables("Email").DefaultView
MyList.DataBind()

Reply to this message...
 
    
=?iso-8859-1?Q?S=E9rgio_Rodelo?=

Dim FirstEmailID as String
FirstEmailID =3D DS.Tables("Email").Rows(0).Item("EmailID")

S=E9rgio Rodelo
Click here to reveal e-mail address

-----Original Message-----
From: Greg Quinn [mailto:Click here to reveal e-mail address]
Sent: quinta-feira, 28 de Fevereiro de 2002 20:53
To: ngfx-oledb
Subject: [ngfx-oledb] How would I get a first value from this dataset?

-- Moved from [aspngcommunity] to [ngfx-oledb] by Charles M. Carroll
<Click here to reveal e-mail address> --

In the code below, I have bound the results of myCommand to a DataGrid
called myList. How would I extract the value of the first emailID
returned
in the same query? I could yuse another query such as SELECT Top 1
EmailID
from Email, but I am terying to avoid 2 queries... Any suggestions..
Here is
my code...

MyCommand =3D New OleDbDataAdapter("Select emailID, theFrom, theSubject,
receivedDate, isRead From Email Where Location =3D 'Inbox'", =
myConnection)

DS =3D new DataSet()
MyCommand.Fill(DS, "Email")

Dim messageID as String
messageID =3D request.querystring("messageID")

MyList.DataSource =3D DS.Tables("Email").DefaultView
MyList.DataBind()

| [ngfx-oledb] member Click here to reveal e-mail address =3D YOUR ID
| http://www.aspfriends.com/aspfriends/ngfx-oledb.asp =3D JOIN/QUIT

Reply to this message...
 
 
System.Data.DataSet
System.Data.OleDb.OleDbDataAdapter
System.Web.UI.WebControls.DataGrid
System.Windows.Forms.DataGrid




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification