473,378 Members | 1,564 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Date Insert Problem in mySQL

Hi,

I am using C# to insert a date value from the DatePicker into a DateTime
filed in mySQL database.. I am using the following syntax:

'" + datePicker.Value + "'
I also triend it withour the ' and with #
in the best scenario I will not get any error but the value will not be
saved in the database, so if I have 10 different values of string,
numeric & date then everything will be inserted successfully except the
date value which will not be inserted and will not return any error
message..
can anyone help please.....

Many Thanks,
Jassim Rahma

*** Sent via Developersdex http://www.developersdex.com ***
Nov 17 '05 #1
2 6679
"Jassim Rahma" <jr****@hotmail.com> wrote in message
news:u8***************@TK2MSFTNGP15.phx.gbl...
I am using C# to insert a date value from the DatePicker into a DateTime
filed in mySQL database.. I am using the following syntax:

'" + datePicker.Value + "'
Does this fix it...?

'" + datePicker.Value.ToString("yyyy/MM/dd") + "'
I also triend it withour the ' and with #


It needs the apostrophe, not the hash.
Nov 17 '05 #2
Thank you very much...
my problem is solved with your answer...

Many Thanks,
Jassim Rahma

*** Sent via Developersdex http://www.developersdex.com ***
Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: PhilM | last post by:
Kindly break out the 4x2 and bring me to my senses. I seem to have gotten myself totally confused with php.net, mysql.org pages on dates etc, as well as groups.google. Could someone explain,...
2
by: Ricky | last post by:
I have a table with a field type date and null is set to yes. How can I insert a blank value without it being save as 0000-00-00. thanks Ricky
8
by: Ray in HK | last post by:
Will it be possible to specify the date format of type DATE during data loading ?
2
by: Paul | last post by:
I am trying to insert a date into a mysql table but everytime I attempt it the date field is always empty. The field is of Date type and the date in code is in European format dd/mm/yyyy. ...
1
by: Rotsj | last post by:
Hi, i'm using visual foxpro 9 with a mysql 5 database, for direct access to my database i use navicat. In visual foxpro i've set my date format to dd-mm-yyyy, also i did this in navicat. However...
1
by: jimmy | last post by:
I'm trying to insert a date into a MySQL date column. The string i am trying to insert takes the following format: 2007-02-23 which corresponds to the date format that MySQL uses which is...
6
by: marc | last post by:
hi im trying to convert Date() into a unix timestamp so i can stick the result into a mysql db, please help!
6
by: ruraldev | last post by:
I have been trying my best to display a chosen date as dd-mm-yyyy but insert it into the mysql database as yyyy-mm-dd, I know it must be simple but no matter what I try I can't get it to work. At...
2
by: zhusupe | last post by:
$sql_string="insert into article(title,content,class_id,post_time,post_time_year,post_time_month) values('".$title_article."','".$content_article."',1,".date('Y-m-j...
3
by: janetopps | last post by:
I have a news website, with asp pages, which was on Access, and i upgraded to MySQL, i used Bullzip to transfer the data. It had about 1000 pages, which im now able to pull up on the public side. Im...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.