http://www.sufeinet.com/plugin.php?id=keke_group

苏飞论坛

 找回密码
 马上注册

QQ登录

只需一步,快速开始

分布式系统框架(V2.0) 轻松承载百亿数据,千万流量!讨论专区 - 源码下载 - 官方教程

HttpHelper爬虫框架(V2.7-含.netcore) HttpHelper官方出品,爬虫框架讨论区 - 源码下载 - 在线测试和代码生成

HttpHelper爬虫类(V2.0) 开源的爬虫类,支持多种模式和属性 源码 - 代码生成器 - 讨论区 - 教程- 例子

查看: 4178|回复: 1

[学生提问] 利用MySQLDriverCS操作mysql查询时间字段出问题,不知道怎么处理

[复制链接]
发表于 2015-6-30 15:37:27 | 显示全部楼层 |阅读模式
1金钱
QQ截图20150630144333.png

报错代码

未处理 System.FormatException
  Message=日历 System.Globalization.GregorianCalendar 中不支持该字符串所表示的 DateTime。
  Source=mscorlib
  StackTrace:
       在 System.DateTimeParse.ParseExact(String s, String format, DateTimeFormatInfo dtfi, DateTimeStyles style)
       在 System.DateTime.ParseExact(String s, String format, IFormatProvider provider)
       在 MySQLDriverCS.MySQLDataReader..ctor(Void* result, MySQLConnection _connection, Statement _stmt, Boolean CloseConnection)
       在 MySQLDriverCS.DirectStatement.ExecuteReader(Boolean CloseConnection)
       在 MySQLDriverCS.MySQLCommand.ExecuteReader(Boolean CloseConnection)
       在 MySQLDriverCS.MySQLCommand.ExecuteReaderEx()
       在 代理商管理工具.Form1.button9_Click_1(Object sender, EventArgs e) 位置 E:\C#\学习例子\代理商管理工具\代理商管理工具\Form1.cs:行号 59
       在 System.Windows.Forms.Control.OnClick(EventArgs e)
       在 System.Windows.Forms.Button.OnClick(EventArgs e)
       在 System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
       在 System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
       在 System.Windows.Forms.Control.WndProc(Message& m)
       在 System.Windows.Forms.ButtonBase.WndProc(Message& m)
       在 System.Windows.Forms.Button.WndProc(Message& m)
       在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       在 System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
       在 System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
       在 System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
       在 System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
       在 System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
       在 System.Windows.Forms.Application.Run(Form mainForm)
       在 代理商管理工具.Program.Main() 位置 E:\C#\学习例子\代理商管理工具\代理商管理工具\Program.cs:行号 18
       在 System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       在 System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       在 Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       在 System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
       在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       在 System.Threading.ThreadHelper.ThreadStart()
  InnerException:

[C#] 纯文本查看 复制代码
 string sql = "SELECT kehu.`序号`, kehu.`联系人`, kehu.`手机号码`, kehu.`QQ号码`, kehu.`客户所在地址`, kehu.`行业分类`, kehu.`公司名称`, kehu.`意向产品`, kehu.`发布时间`, kehu.`回访情况`, kehu.`回访时间`, kehu.`平台`, kehu.`客户级别`, kehu.`入库时间` FROM kehu WHERE kehu.`入库时间` <'"+sqltime+"'"; 

           
            V.SQLCommand = new MySQLCommand(sql, V.conn);//执行SQL语句
            //int rcount = SQLCommand.ExecuteNonQuery();//返回查询到多少行

            V.temp_DataReader = V.SQLCommand.ExecuteReaderEx();//读取记录集 




1. 开通SVIP会员,免费下载本站所有源码,不限次数据,不限时间
2. 加官方QQ群,加官方微信群获取更多资源和帮助
3. 找站长苏飞做网站、商城、CRM、小程序、App、爬虫相关、项目外包等点这里
 楼主| 发表于 2015-6-30 15:38:19 | 显示全部楼层
SELECT kehu.`序号`, kehu.`联系人`, kehu.`手机号码`, kehu.`QQ号码`, kehu.`客户所在地址`, kehu.`行业分类`, kehu.`公司名称`, kehu.`意向产品`, kehu.`发布时间`, kehu.`回访情况`, kehu.`回访时间`, kehu.`平台`, kehu.`客户级别`, kehu.`入库时间` FROM kehu WHERE kehu.`入库时间` <'2015-06-30 15:38:04'
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 马上注册

本版积分规则

QQ|手机版|小黑屋|手机版|联系我们|关于我们|广告合作|苏飞论坛 ( 豫ICP备18043678号-2)

GMT+8, 2024-5-2 15:35

© 2014-2021

快速回复 返回顶部 返回列表