| | |
Date and Time
Please support our ASP.NET advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jun 2006
Posts: 22
Reputation:
Solved Threads: 0
hi
i want to insert the current date and time in the sql server database... but i dont know how or what is the formulla exactly..i tried several time but all failed...
basicly what i want is when someone log in the site with the membership the session("Date") will be created, the date and time will be recorded in the sql server database in column date which has a data type of smalldatetime
can anyone help me whith this plz
i want to insert the current date and time in the sql server database... but i dont know how or what is the formulla exactly..i tried several time but all failed...
basicly what i want is when someone log in the site with the membership the session("Date") will be created, the date and time will be recorded in the sql server database in column date which has a data type of smalldatetime
can anyone help me whith this plz
In the ASP.NET page do something like this
(Assuming your data entry for date is a calendar).. it is the principle / logic here that matters.. not the methods
example of this in SQL Server
Result: 2000-05-08 12:35:00
Hope this helps
(Assuming your data entry for date is a calendar).. it is the principle / logic here that matters.. not the methods
ASP.NET Syntax (Toggle Plain Text)
Session("Date") = Calendar1.Selected + " " + DateAndTime.TimeOfDay '.... '.... cmd.commandText = "UPDATE tblName " _ SET dtm_column = CAST('" & CStr(Session(Date")) & "' AS smalldatetime) WHERE blah = blah ...
example of this in SQL Server
SELECT CAST('2000-05-08 12:35:29.998' AS smalldatetime) go
Hope this helps
![]() |
Similar Threads
- I just need TIME not Date. (MS SQL)
- Display client's PC Date & Time (ASP.NET)
- Access Date & Time Validation Question (MS Access and FileMaker Pro)
- arrange date&time column (MySQL)
- How to Get Last Accessed/Created/Modified File Date and Time (C)
- inputing system("date /t") and system("time /t") into a file (C++)
Other Threads in the ASP.NET Forum
- Previous Thread: error!
- Next Thread: variables from javascript in asp.net
Views: 1921 | Replies: 3
| Thread Tools | Search this Thread |
Tag cloud for ASP.NET
.net 2.0 3.5 ajax appliances application asp asp.net beginner box browser businesslogiclayer button c# cac chat checkbox child class compatible complex content contenttype control countryselector courier database datagrid datagridview datalist deployment development dgv dialog dropdown dropdownmenu dynamic dynamically edit embeddingactivexcontrol feedback fileuploader fill findcontrol flash flv folder form gridview gudi identity iis image javascript languages list maps menu mobile mssql nameisnotdeclared novell opera order problem profile ratings redirect refer registration relationaldatabases response.redirect rows search security select serializesmo.table sessionvariables silverlight smoobjects software sql ssl tracking treeview typeof validatedate validation vb vb.net vista visual-studio visualstudio vs2008 web webapplications webarchitecture webdevelopment wizard xsl





