TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Carlos Sanchez
NA
264
0
Insert DateTime in a field
Jul 13 2004 12:29 PM
I have the next code: SqlCommand command = new SqlCommand(); command.CommandText = "INSERT INTO Custumers (Num, Name, Address,City, State, BirthdayDate) VALUES (" + txtNum.Text + "," + txtName.Text + "," + txtAddress.Text + "," + txtCity.Text + "," + txtState.Text + "," + dtpBirthdatDate.Value.Date + ")"; command.ExecuteNonQuery(); dtpBirthdayDate is a DateTimePicker Component. When the command is executed the next error is ocurred: Line 1: Incorrect syntax near '12'. Any TextBox have the "12" string n' the dtpBirthdayDate (DateTimePicker) have {7/13/2004}. But when I start the application step by step, I can see that the dtpBirthdayDate value is 07/13/2004 12:00:00 a.m. may be this is the problem, but what can I do? can sombody help me?
Reply
Answers (
7
)
Communication over xml between java and c#
How to find IIS services and the website's under IIS are running?