473,396 Members | 1,933 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,396 software developers and data experts.

data question (ASP.NET2.0 - C#)

I am making a fairly simple help desk program. when a new ticket is created
it is sent in to two tables.

TICKETS and CONVERSATIONS

the username, computer, topic and subject go in to TICKETS and the problem
description goes in to CONVERSATION

the problem is i need the TICKET_ID from the TICKETS table to insert in to
the CONVERSATION table..

what i can do is do the insert and then query the TICKET_ID field for max
(its an identity, counts up, highest number is the new ticket)

but im guessing there is some nice way to do this in ASP.NET/C#

so i guess what im looking for is..... is there a way to return the auto
generated ticket_id from the insert?

Thanks
Justin
Nov 19 '05 #1
2 1090
You should look at changing your insert to also include a select SCOPE_IDENTITY()
call:

Fredrik discusses this here:

http://fredrik.nsquared2.com/viewpos...wfeedback=true

-Brock
DevelopMentor
http://staff.develop.com/ballen
I am making a fairly simple help desk program. when a new ticket is
created it is sent in to two tables.

TICKETS and CONVERSATIONS

the username, computer, topic and subject go in to TICKETS and the
problem description goes in to CONVERSATION

the problem is i need the TICKET_ID from the TICKETS table to insert
in to the CONVERSATION table..

what i can do is do the insert and then query the TICKET_ID field for
max (its an identity, counts up, highest number is the new ticket)

but im guessing there is some nice way to do this in ASP.NET/C#

so i guess what im looking for is..... is there a way to return the
auto generated ticket_id from the insert?

Thanks
Justin


Nov 19 '05 #2
thats awesome.. thanks!

"Brock Allen" <ba****@NOSPAMdevelop.com> wrote in message
news:86**********************@msnews.microsoft.com ...
You should look at changing your insert to also include a select
SCOPE_IDENTITY() call:

Fredrik discusses this here:

http://fredrik.nsquared2.com/viewpos...wfeedback=true

-Brock
DevelopMentor
http://staff.develop.com/ballen
I am making a fairly simple help desk program. when a new ticket is
created it is sent in to two tables.

TICKETS and CONVERSATIONS

the username, computer, topic and subject go in to TICKETS and the
problem description goes in to CONVERSATION

the problem is i need the TICKET_ID from the TICKETS table to insert
in to the CONVERSATION table..

what i can do is do the insert and then query the TICKET_ID field for
max (its an identity, counts up, highest number is the new ticket)

but im guessing there is some nice way to do this in ASP.NET/C#

so i guess what im looking for is..... is there a way to return the
auto generated ticket_id from the insert?

Thanks
Justin


Nov 19 '05 #3

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

Similar topics

3
by: Brian Henry | last post by:
is there any documentation out there on master pages and the different looking themes folder in asp.net 2.0 that i could start getting up to speed with this on to start learning the new changes?...
0
by: Sri Reddy | last post by:
Hi I want to create a horizontal menu on my website being built using asp.net2 with menu items based on the "role" of the user who logged into the system.Role iformation will be read from...
4
by: InnoCreate | last post by:
Hi everyone, I've developed a couple of asp.net1.1 websites and these are viewable using my mobile phone. I've now moved over to asp.net2 and i'm unable to view asp.net2 websites on my phone. I've...
1
by: Palani | last post by:
Hi I have started writing an ASP.NET2.0 FTP web client, I would like to use FTPWebRequest class. I am new to ASP.NET2.0. Can anybody help me with a sample ASP.NET application?
9
by: dreamamit2001 | last post by:
Hi, I am new user to ASP.NET2.0? I would like to know can Macintosh users able to access ASP.NET 2.0 site ? I also want to know what are the features of ASP.NET2.0 which are not supported for...
1
by: =?Utf-8?B?SWJyYWhpbQ==?= | last post by:
I have probelm to deploy ASP.net2 Application implement in this Application the Virtual path provider techinque what I have done : 1- built the web Application with Asp.net2 as File system...
4
by: Greoasy | last post by:
Hi, i want to create a login page in asp.net 2.0 where in there are many different users and they have acess to different pages.All details of the users are stored in a table in an sql server...
2
by: CBasha | last post by:
HI to all, Here I am working on asp.net2.0 and C# can u pls help me for Sending an email in asp.net2.0 using C#, thanks in Advance ...
1
by: bhappy | last post by:
Hi all, Why <Frameset> tag is not worked in asp.net2.0.If anybody have any idea plz tell me.And which tag is used insted of <frameset> in asp.net2.0 to divide the window(Frame). Thanks, Aswath.
2
by: Ronald S. Cook | last post by:
If I understand correctly, the framework version and Visual Studio version are not intertwined? Assuming so, how do I (first) find out what framweork my VS2005 ASP.NET application is targeting...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.