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

Getting last value and increasing it by one

2
Hello,
My name is Tim and I am new here so i would just like to start of with saying hi to everyone!

the problem i have is i am using asp.net and SQL and I want to get the last value of the called vidid and increase it by one.

I have found this code
SELECT MAX(vidid) + 1
FROM dbo.Videos

I am using dreamweaver 8 and I use the test button and it submits it and comes up with the value i want.

I then press ok and go to bindings to get the value and there are no binding so i wrote the code in my self and it does not display anything not even a error msg.

I have also tryed this code

SELECT vidid + 1
FROM dbo.Videos
ORDER BY vidid DESC

This does not work aswell but if i remove the + 1 then i see that last value.

Any ideas ?? like alternate code

Thanks

Tim
Jul 17 '07 #1
3 1232
DonlonP
25
Hello,
My name is Tim and I am new here so i would just like to start of with saying hi to everyone!

the problem i have is i am using asp.net and SQL and I want to get the last value of the called vidid and increase it by one.

I have found this code
SELECT MAX(vidid) + 1
FROM dbo.Videos

I am using dreamweaver 8 and I use the test button and it submits it and comes up with the value i want.

I then press ok and go to bindings to get the value and there are no binding so i wrote the code in my self and it does not display anything not even a error msg.

I have also tryed this code

SELECT vidid + 1
FROM dbo.Videos
ORDER BY vidid DESC

This does not work aswell but if i remove the + 1 then i see that last value.

Any ideas ?? like alternate code

Thanks

Tim
Hi Tim,

I'm not familiar with dreamweaver but your original SQL query should work. If it returns a value in query analyser then make sure you're binding it correctly and also check your database connection string in .net.
Jul 22 '07 #2
Renar
2
Hi Tim,

I'm not familiar with dreamweaver but your original SQL query should work. If it returns a value in query analyser then make sure you're binding it correctly and also check your database connection string in .net.
hello thanks for responding...
i used a sqlcommand instead and its working now but thanks anyway.
Jul 25 '07 #3
hi
if you use this value for inserting new record in a multi user application your solution may not work.check it.
Jul 25 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Carlos San Miguel | last post by:
Hi, I'm going to be using Oracle with a customer. I will access Oracle with ODBC. All the tables have an Identity column, this is the ID for the record. I need to know how I can get the value of...
0
by: Jim | last post by:
I need some help getting started with a .NET web project for a commercial site. I am new to .NET and my understanding of some (but not all) of its concepts is a little sparse. I apologize for the...
0
by: Jim | last post by:
This si a repost, I apologize but perhaps my original inquiry got buried under all the usenet spam... I need some help getting started with a .NET web project for a commercial site. I am new to...
11
by: David Messner | last post by:
Ok I know this is simple but the statement eludes me... I have a date field where I want the default value on the data entry form's date field to be the last date entered. I figure I can do this...
4
by: Sean Shanny | last post by:
To all, Running into an out of memory error on our data warehouse server. This occurs only with our data from the 'September' section of a large fact table. The exact same query running over...
4
by: Gary | last post by:
Hi, I have a temperature conversion program down pat, but I was told to add an average, meaning, i need to get the average temperature for as many times as it was entered. i do not know where to...
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)...
15
by: dennis.richardson | last post by:
Greetings all. Here's a problem that's been driving me nuts for the last 48 hours. I'm hoping that someone has come across this before. I have a C# Application that reads a UDP broadcast...
1
by: simbarashe | last post by:
Hie could someone please help me with getting and using the current page url. I have a function that gets the url, I want to use it with header(location : XXX) but it wont work. The code is as...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: 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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.