Home » VB.NetRSS

save date to mysql database

front end: vb.net

backend: mysql

Hello Community,

I am trying to save a date to a mysql database and usually the only format permited to be saved in the table is YYYY-MM-DD

On the form the datetime picker is formated like this MM-DD-YYYY

The thing is i am using dataset created by wizard to save the data, what should i do to be able to format this for save and read because it is giving me errors.

Thanks in advance,

Best Regards.

 

10 Answers Found

 
 

Answer 2

yes but the problem i am using dataset  created by wizard, where should i use that?
 

Answer 3

If I understand you question, can't you change your query using the Dataset Designer?
 

Answer 4

INSERTINTO inventory
             (NAME, Address, Phone, Vin_No, TYPE, Category, YEAR, Make, Model, Style_Name, Engine_Size, Fuel_Type, Cylinder, Transmission, Body_Style, Drive_Train, Color,
             Title_No, Date_In, Miles_In, Mileage_Unknown, Beyond_Mechanical, Initial_Cost, Work_Parts_Cost, Auction_Fee, Warehouse, Branch, `User`)
VALUES    ('a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a',
             'a', 'a', 'a', 'a', DATE_FORMAT('12/12/2008', '%Y-%m-%d'), 'a', 1, 1, '100',
             'a', 'a', 'a', 'a', 'a')

it doesn't work..
 

Answer 5

No mention of exception messages. Could you be a bit more specific when you say "doesn't work"?
 

Answer 6


it doesn't work..
Did you plug in the power of your computer?
 

Answer 7

i have a laptop, it can run on battery :P
 

Answer 8

No mention of exception messages. Could you be a bit more specific when you say "doesn't work"?
Paul ~~~~ Microsoft MVP (Visual Basic)

Paul, the thing  is, it doesn't raise any error, it just inserts a blank date...
 

Answer 9

Hi,

try this one:

INSERTINTO inventory
   (NAME, Address, Phone, Vin_No, TYPE, Category, YEAR, 
    Make, Model, Style_Name, Engine_Size, Fuel_Type, Cylinder, 
    Transmission, Body_Style, Drive_Train, Color,
    Title_No, Date_In, Miles_In, Mileage_Unknown, Beyond_Mechanical, Initial_Cost, Work_Parts_Cost, Auction_Fee, Warehouse, Branch, `User`)
VALUES 
    ('a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a',
     'a', 'a', 'a', 'a', DATE_FORMAT('12/12/2008', '%Y%m%d'),
     'a', 1, 1, '100','a', 'a', 'a', 'a', 'a')

 

Answer 10

No mention of exception messages. Could you be a bit more specific when you say "doesn't work"?
Paul ~~~~ Microsoft MVP (Visual Basic)

Paul, the thing  is, it doesn't raise any error, it just inserts a blank date...
Shouldn't the format  of your date  value be year, month, day and not month, day, year?
 
 
 

<< Previous      Next >>


Microsoft   |   Windows   |   Visual Studio   |   Follow us on Twitter