Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > MySQL
|
MySQL General discussion about the MySQL database.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the MySQL section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 10th, 2007, 04:23 AM
Authorized User
 
Join Date: Jan 2007
Posts: 93
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to aliirfan84
Default MySql with .Net

I m using .Net(2.0) with MySql 5.0. When I execute following command using ExecuteNonQuery() it throws excepiotn but this query works well when I execute in MySql Query Browser.

"Insert into SYN_TLog(LogId,ClientId,LogDate,LogDirection,ToCli ent,FileName,FilePath,FileCount,EnteredOn) Values(1,'1',str_to_date('09/04/2007 09:31:29 AM','%d/%m/%Y %h:%i:%s %p'),'I','0002','0001-Log-060407010600PM.xml','C:\\Synchronizer\\Inbox\\UnPo sted\\',1,str_to_date('09/04/2007 09:31:29 AM','%d/%m/%Y %h:%i:%s %p'))"

EXCEPTION

" ERROR [23000] You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '09/04/2007 01:48:57 PM','%d/%m/%Y %h:%i:%s %p'))' at line 1 ".

Please help me to solve this problem.

__________________
Regards,
Ali Irfan
 
Old April 10th, 2007, 06:54 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

What is str_to_date? Is this a user defined function on your server?

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========
 
Old April 11th, 2007, 03:05 AM
Authorized User
 
Join Date: Jan 2007
Posts: 93
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to aliirfan84
Default

str_to_date() is MYSQL function to convert string to date according to format specified in second argument.






Similar Threads
Thread Thread Starter Forum Replies Last Post
c# connection string for .Net 1.1 with Mysql srkarthik_82 General .NET 0 January 17th, 2007 06:58 AM
.NET and MySQL DateTimes in C# Ric_H ASP.NET 1.x and 2.0 Application Design 5 December 15th, 2006 12:00 PM
ASP.Net 2.0 with MySQL burdickdave ASP.NET 2.0 Professional 2 March 3rd, 2006 08:10 PM
MySQL 5 with ASP.Net 2.0 burdickdave MySQL 1 February 22nd, 2006 08:37 PM
vb.net and mysql pascalgeuze VB.NET 1 January 21st, 2005 07:33 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.