日期:2014-05-20  浏览次数:20743 次

技术区没分了,帮忙改个小地方,谢谢!
this.timer1.Interval = 180000; //定时器设置成3min刷新一次
  timer1.Enabled = true;
  SqlCommand cmd = new SqlCommand();
  this.newPOPDataSet.Clear();
  connetionString = "Data Source=.;Initial Catalog=ss;User ID=sa;Password=ss";
  connection = new SqlConnection(connetionString);
  SqlConnection con = new SqlConnection();
  string ls_date = System.DateTime.Now.ToString("yyyy-M-d");//取今日时间

  try
  {

  connection.Open();
  adapter = new SqlDataAdapter(sqlcmd, connection);
  adapter.Fill(ds);
  connection.Close();
  dataGridView1.DataSource = ds.Tables[0];
  if (ds.Tables[0].Rows.Count == 0)//没有异常值
  {
  //return ;
  MessageBox.Show(ls_date);
  }
  ------------后面省略 -----
断点跟踪时 发现这一句存在问题,2011-11-23 为整数类型,我申明的是字符类型, 这里该怎么改?
select Serialno ,machineCd ,RevWireCutlen from V_buzhengzhi_check where (RevWireCutlen >-100 or RevWireCutlen <100) and CONVERT(varchar(10),updatedatetime,120)=2011-11-23

------解决方案--------------------
...)='" + ls_date + "'"