Select Categories Below
Advertisement
Start Your Own Q&A Site
Create your own Q&A site easily, allowing you to quickly grow a new community around any subject matter or generate new organic traffic for your existing website.
Status: Open Points: 125 Time: 05:01 - May 05, 2008
mike2098
I am ussing SQL Express and VB 2005 on Vista x64 I am trying to create a simple table with userID double email Varchar date (datetime) so when a new record is added it is timestamped in the database I have tried ussing [Date] but it either resets to Date or [Date]]] neither insert a date into the database. I need to use the date time for a query to be run that will email all the email addresses from the last 24 hrs so I need help with the date and also is there a way of of using a timer to query the database and send and email thanks
Categories:
Add Categories
When adding more than one category, separate them with commas.
rcastagna
Date:: Sep 25, 2008
Time:: 09:39
Mike, Using SQL Management Studio Express, open the database and table you're working with. If you will highlight the "date" column and look at the properties (usually displayed below the table designer) you will see a property for "Default Value". Enter "getDate()" into that default value column and it will automatically set the current system timestamp into the database. Alternatively, you could add a parameter to your insert statement that would add the date in as well. SqlConnection cn = new SqlConnection("YourConnectionString"); SqlCommand cmd = new SqlCommand("InsertRecord", cn); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@UserID", SqlDbType.Decimal).Value = userID; cmd.Parameters.Add("@Email", SqlDbType.VarChar).Value = email; cmd.Parameters.Add("@Date", SqlDbType.DateTime).Value = DateTime.Now; cn.Open(); cmd.ExecuteNonQuery(); cn.Close(); The way to automatically email folks could be done with a Windows Service or perhaps a scheduled job. For the scheduled job you'll need to consider Windows Script Host or whatever is the current replacement. I prefer to use the service approach. Let me know if there's anything else I can do to help you on the way. Take care, Ric
admin
Date:: Mar 24, 2009
Time:: 09:49
The question looks to be abandoned by the user who asked it. If no action is taken within 2 days, a Quomon Moderator will consider closing the question and distributing the points. The Quomon Team
Answer this Question
New User
Email:
Upon submission of this form, you will automatically be registered as a Quomon user and we will send your login information to this address
Registered User
Username:
Password:
Forgot Your Password?
Enter your email address below and we will resend your login information to you.
Login Information Sent
Questions
whats the best food to eat during midnight?
How to identify the tiffany jewelry? www.tffanycheapmall.com.
Send an email alert to each user of the php application based on criteria
How I Increased My AdSense Earnings?
how to choose the lady dress ?
How can I fulfill the minimum requirement to make your computer support 3D?
You have 100 characters to use
Rank
Expert
Points
1.
10354
2.
6493
3.
5596
4.
4848
5.
3487
6.
2840
7.
2770
8.
2303
9.
1820
10.
917
Register today to share your knowledge with the community and be recognized and rewarded for your contributions.
Register Here
"Psst, Quomon is a great site. Pass it on." Tell a Friend | Link To Us | Save to Delicious | Digg it
Language Options
English:
Español:
Sponsors
Questions and Answers Software