Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > ADO.NET
|
ADO.NET For discussion about ADO.NET.  Topics such as question regarding the System.Data namespace are appropriate.  Questions specific to a particular application should be posted in a forum specific to the application .
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ADO.NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 24th, 2006, 04:26 AM
Authorized User
 
Join Date: Dec 2005
Posts: 52
Thanks: 0
Thanked 0 Times in 0 Posts
Default Inserting Time Stamp into SQL

Hi folks,

What I am trying to achieve is when a user logs into my website their username and password is checked against a table in SQL, if their details exists it puts a time stamp in the SQL table of when they last logged in.

Now I got the first part working without a problem, users loggin into and out, but I cannot for the life of me get my head around the last part. In the SQL table I have a field named [Username], a field named [Password], and a field named [Last Login].

I am using Visual Studio 2005 with VB, if anyone has got any code exmaples please let me know.

Thanks!!

 
Old May 19th, 2006, 07:14 AM
Friend of Wrox
 
Join Date: May 2006
Posts: 106
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Let Com is command Object
Update logintable set [Last Login]=@log where [username]=@ur
Com.Parameters.Add("@log",SqlDbType.DateTime,Syste m.DateTime.Now.ToString())
com.Parameters.Add("@ur",usernm)

Bijgupt





Similar Threads
Thread Thread Starter Forum Replies Last Post
time in sql server is not real time hertendreef SQL Server 2005 6 April 19th, 2007 07:07 AM
store insert/update date/time stamp in sql2k db alexdcosta ASP.NET 2.0 Basics 0 June 22nd, 2006 05:44 AM
Inserting mulitible rows in one table at one time mohanrajb Classic ASP Databases 1 June 21st, 2005 10:09 AM
Date/Time Stamp on Reports dillig BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 1 August 11th, 2004 08:21 AM
Inserting just the time segment Trojan_uk SQL Server ASP 1 April 15th, 2004 10:03 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.