Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 INSERTING usernames and dates into Database

Author  Topic 

adamfleming10
Starting Member

3 Posts

Posted - 2008-05-23 : 13:22:48
Ok, this may seem like a noob question to most of you, but i have a bit of a problem i cant get over!

Trying to implement a blog-type system into a site. Ok its easy enough inserting new items into the database with a title and message, but how do i insert the current users username into the database, and also the current date into the database.

So when a user is looking at the blog it will show the title, message, date it was posted and the user who posted it. Please help!

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-05-23 : 13:37:16
First, why are you writing your own blog-type software when there are so many free packages out there?

Second, don't you have the username already? Can't you get the current date from whatever programming language that you are using such as VB.NET with Now?

Dim Now AsDateTime = DateTime.Now
MessageBox.Show(Now)

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Database maintenance routines:
http://weblogs.sqlteam.com/tarad/archive/2004/07/02/1705.aspx
Go to Top of Page
   

- Advertisement -