Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Adding New Records.
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Adding New Records.

 Post Reply Post Reply
Author
davidshq View Drop Down
Senior Member
Senior Member


Joined: 29 July 2003
Location: United States
Status: Offline
Points: 299
Post Options Post Options   Thanks (0) Thanks(0)   Quote davidshq Quote  Post ReplyReply Direct Link To This Post Topic: Adding New Records.
    Posted: 16 July 2004 at 10:47am

I'm to the Add New Records page now...And I am having a bit of a problem. My records look likes follows:
ID (unique identifier)
mMonth (event month)
mDay (event day)
mYear (event year)
mEvent (event description)
It is quite simple for me to take the text from the user's input in text boxes and assign it to each of these values, but I haven't created and don't want to create an ID textbox. Rather, I want the ID to auto-incremement. Does anyone know how to do that in ASP.NET?
So, what I need is for the script to realize that the database already has 567 records and thus to automatically label the ID as 568.
Respectfully,
David.

Back to Top
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post Posted: 16 July 2004 at 10:50am

You don't need to worry about that, as long as you set the data type to autonumber in access or used IDENTITY INCREMENT in SQL Server it will be done automatically, you just don't use it in the query i.e.

INSERT INTO [table] VALUES ('Month', 'Day', 'Year', 'Event')

btw Why don't use have a mDate field with DataType DateTime instead of having three differant fields?

Back to Top
davidshq View Drop Down
Senior Member
Senior Member


Joined: 29 July 2003
Location: United States
Status: Offline
Points: 299
Post Options Post Options   Thanks (0) Thanks(0)   Quote davidshq Quote  Post ReplyReply Direct Link To This Post Posted: 16 July 2004 at 11:14am
Thanks Mart. :-) Hmmm...thats a good question. I think because I never learned about it. I'm afraid I'm still starting off with all this. I read about it a while back, but this is my first real application since I wrote it in ASP. Other than that, once Web Matrix makes a database and you enter info. into it, it can't work with the structure anymore...just the contents.
Respectfully,
David.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.