PC Review


Reply
Thread Tools Rate Thread

What is the Best way to fetch the most recent updated row in a database

 
 
jagrat@gmail.com
Guest
Posts: n/a
 
      28th Jan 2005
I am having an OleDBDataAdapter and a dataset. I fill the dataset with
a row and execute

Adapter.update(dataset,"Table Name");
Adapter.fill(dataset,"Table Name");

For the database table, my primary key is an auto number.

Currently, I am fetching the key using:

dataset.Tables["Table Name"].Rows[0].ItemArray[0]

It is working because this is the only row added into my table.
But I am certain that there should be a better alternative to this.
Waiting for response.

Jag

 
Reply With Quote
 
 
 
 
W.G. Ryan eMVP
Guest
Posts: n/a
 
      28th Jan 2005
check out www.betav.com - Articles, MSDN - Retrieving the Gozoutas

--
W.G. Ryan, MVP

www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I am having an OleDBDataAdapter and a dataset. I fill the dataset with
> a row and execute
>
> Adapter.update(dataset,"Table Name");
> Adapter.fill(dataset,"Table Name");
>
> For the database table, my primary key is an auto number.
>
> Currently, I am fetching the key using:
>
> dataset.Tables["Table Name"].Rows[0].ItemArray[0]
>
> It is working because this is the only row added into my table.
> But I am certain that there should be a better alternative to this.
> Waiting for response.
>
> Jag
>



 
Reply With Quote
 
Miha Markic [MVP C#]
Guest
Posts: n/a
 
      28th Jan 2005
Are you using Access database?

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
SLODUG - Slovene Developer Users Group
www.rthand.com

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I am having an OleDBDataAdapter and a dataset. I fill the dataset with
> a row and execute
>
> Adapter.update(dataset,"Table Name");
> Adapter.fill(dataset,"Table Name");
>
> For the database table, my primary key is an auto number.
>
> Currently, I am fetching the key using:
>
> dataset.Tables["Table Name"].Rows[0].ItemArray[0]
>
> It is working because this is the only row added into my table.
> But I am certain that there should be a better alternative to this.
> Waiting for response.
>
> Jag
>



 
Reply With Quote
 
jagrat@gmail.com
Guest
Posts: n/a
 
      28th Jan 2005
Hi Miha,

I am using Access database.

 
Reply With Quote
 
Miha Markic [MVP C#]
Guest
Posts: n/a
 
      28th Jan 2005
Hi,

Check out
Retrieving Identity or Autonumber Values
..net help topic.
MSDN Oct link
(ms-help://MS.VSCC.2003/MS.MSDNQTR.2004OCT.1033/cpguide/html/cpconretrievingidentityorautonumbervalues.htm)

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
SLODUG - Slovene Developer Users Group
www.rthand.com

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi Miha,
>
> I am using Access database.
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
fetch data from a Sql server database Tony Johansson Microsoft C# .NET 1 17th Jun 2009 02:20 PM
Multiple connections to fetch hierarchy from database Henke Microsoft ADO .NET 8 7th Oct 2004 04:04 AM
Re: Fetch data from two different database -Datagrid control Phil Winstanley [Microsoft MVP] Microsoft ASP .NET 1 15th May 2004 03:58 PM
Fetch data from two different database -Datagrid control aftab Microsoft ASP .NET 0 15th May 2004 02:46 PM
Recent Files not updated Eric Robishaw Microsoft Dot NET 1 10th Oct 2003 05:53 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:29 AM.