473,659 Members | 3,475 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Valu e + "'
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 6703
"Jassim Rahma" <jr****@hotmail .com> wrote in message
news:u8******** *******@TK2MSFT NGP15.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.Valu e + "'
Does this fix it...?

'" + datePicker.Valu e.ToString("yyy y/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
7658
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, even using pseudo code, how to take a text input I have set up as YYYY-MM-DD using php, and convert to a value mysql will insert into a Date (not timestamp, not datetime) field. Kind regards, and thanks in advance,
2
2545
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
11131
by: Ray in HK | last post by:
Will it be possible to specify the date format of type DATE during data loading ?
2
17385
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. Does the date have to be formatted in any particualr way from vb.net.
1
5079
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 when i insert a date into my database i have to insert it with the format yyyy-mm-dd. Is this a setting in mysql or is there another reason? Thanks. Rotsj.
1
2233
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 YYYY-MM- DD. When i insert this into the database through an INSERT query however the date field uses the value 0000-00-00. Why might this be? Thanks
6
34084
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
3969
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 the moment the date is displayed as dd-MM-yyyy but of course this won't add to the mysql database, if I change the display to yyyy-MM-dd then it displays in that format (which I don't want) but will add to the database OK. I had thought that I...
2
1877
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 H:i:s').",".date('Y').",".date('m').")"; ¡°date(Y-m-j H:i:s)¡± £­£­¡· mysql datetime , it can't work. mysql datetime date( ? ) ?
3
3532
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 sorting out a few glitches though. Since i upgraded from ms access database to MySQL, i have added about 4 articles to test the new setup. I note some fields aren't being added in the new mySql database for the new 4 records. When i ran the MySQK...
0
8428
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8337
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8748
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
6181
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5650
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4175
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4335
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2754
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1739
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.