473,320 Members | 1,831 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

@@Identity not using procedure

Hi friends,
Is there a way to get the last code inserted in my database without a
procedure...direct in the code-behind ? some method ? some property ?

Thanks in advance
Nov 19 '05 #1
5 851
Yes, run a batch like

insert ...;select scope_identity()

Eliyahu

"Paperback Writer" <ne*********@gmail.com> wrote in message
news:%2******************@tk2msftngp13.phx.gbl...
Hi friends,
Is there a way to get the last code inserted in my database without a
procedure...direct in the code-behind ? some method ? some property ?

Thanks in advance

Nov 19 '05 #2
Afraid not. Unless you do something with your Stored proc and using
ExecuteScalar, ASP.NET has no connection to SQL and wouldn't know last
identity.

Sorry. If it were possible, life would be tremendously easy.

Clint Hill
H3O Software
http://www.h3osoftware.com

Paperback Writer wrote:
Hi friends,
Is there a way to get the last code inserted in my database without a
procedure...direct in the code-behind ? some method ? some property ?

Thanks in advance

Nov 19 '05 #3
Afraid not. Unless you do something with your Stored proc and using
ExecuteScalar, ASP.NET has no connection to SQL and wouldn't know last
identity.

Sorry. If it were possible, life would be tremendously easy.

Clint Hill
H3O Software
http://www.h3osoftware.com

Paperback Writer wrote:
Hi friends,
Is there a way to get the last code inserted in my database without a
procedure...direct in the code-behind ? some method ? some property ?

Thanks in advance

Nov 19 '05 #4
Yeah...it worked...very good...thanks!

"Eliyahu Goldin" <re*************@monarchmed.com> escreveu na mensagem
news:e7**************@tk2msftngp13.phx.gbl...
Yes, run a batch like

insert ...;select scope_identity()

Eliyahu

"Paperback Writer" <ne*********@gmail.com> wrote in message
news:%2******************@tk2msftngp13.phx.gbl...
Hi friends,
Is there a way to get the last code inserted in my database without a
procedure...direct in the code-behind ? some method ? some property ?

Thanks in advance


Nov 19 '05 #5
Yeah...it worked...very good...thanks!

"Eliyahu Goldin" <re*************@monarchmed.com> escreveu na mensagem
news:e7**************@tk2msftngp13.phx.gbl...
Yes, run a batch like

insert ...;select scope_identity()

Eliyahu

"Paperback Writer" <ne*********@gmail.com> wrote in message
news:%2******************@tk2msftngp13.phx.gbl...
Hi friends,
Is there a way to get the last code inserted in my database without a
procedure...direct in the code-behind ? some method ? some property ?

Thanks in advance


Nov 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Szaki | last post by:
I must import some exemplary file to database (MS Srrver 2000) ofcourse using procedure Transact SQL. This file must: 1.Read the xml file 2. Create table 3. Import this date from xml file to my...
2
by: Devesh Aggarwal | last post by:
Hi, I have a backup and restore module in my project. The backup uses a typed dataset object (XSD) to get the data from database and creates a xml file as the backup file (using the WriteXml...
2
by: mr_mach7 | last post by:
I have a situation in which I want to dynamically build a SQL statement based upon criteria. The statement would contain different fields depending upon the criteria. I created a Stored Procedure...
41
by: pb648174 | last post by:
In a multi-user environment, I would like to get a list of Ids generated, similar to: declare @LastId int select @LastId = Max(Id) From TableMania INSERT INTO TableMania (ColumnA, ColumnB)...
2
by: tanha kris | last post by:
CREATE OR REPLACE PROCEDURE gopal IS ReceivingSection VARCHAR2(20); DakId VARCHAR2(6); CURSOR c_Inward_DocumentDetails IS select DAK_Id, RECEIVING_SECTION into...
2
by: abhu50 | last post by:
i have coded following program for taking losal and hi sal from table salgrade and now using procedure add2 that is following:- create or replace procedure add2(a in number,b in number,c out...
1
by: Genken | last post by:
Hi i recently wrote a seach engine type website using access. The problem is now i have to convert all my queries to stored procedures; some of my vbscripting code calls certain queries as tables. ...
6
by: maanasa | last post by:
hi, i've one question. I'm supposed to create oracle user on click of a button using oracle forms. I'm calling a procedure which i've written in sql+ which is supposed to create the user. The...
4
by: umer786 | last post by:
Asalam u AlaikuM! hello frndz, here iz a problem that i hv faced i.e: i m from Pakistan n i m reading the Visual Basic in my college! our teacher give us a assignment of visual basic i.e"...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.