Chinaunix首页 | 论坛 | 博客
  • 博客访问: 520825
  • 博文数量: 88
  • 博客积分: 2256
  • 博客等级: 大尉
  • 技术积分: 921
  • 用 户 组: 普通用户
  • 注册时间: 2009-12-08 23:20
个人简介

积硅步,行千里

文章分类

全部博文(88)

文章存档

2019年(5)

2018年(1)

2016年(15)

2015年(23)

2013年(3)

2012年(6)

2011年(3)

2010年(22)

2009年(10)

我的朋友

分类: C#/.net

2015-04-15 14:10:20


  1. Dim dataAdapter As New SqlDataAdapter
  2.         Dim dst As New DataSet
  3.         Dim dt As New DataTable
  4.         Dim i As Integer
  5.         Dim iQty As Double
  6.         Dim iMoney As Double

  7.         Dim sqledi As New SqlConnection(connEDI)

  8.         If TextBox1.Text = "" Then
  9.             MsgBox("请输入单号")
  10.             Exit Sub
  11.         End If

  12.         sqledi.Open()
  13.         sql = "SELECT dDate, cCode, cPART_NO, cInvCode, cInvName, cInvStd, cBatch, iQty, iPrice, "
  14.         sql = sql & " iMoney, cUnit, iUnitID, cCurr, iCurrID, cUser, cIN_COMP_CODE, cOUT_COMP_CODE, "
  15.         sql = sql & " dUpDate, Guid, cMemo, cB2BFileName, dAddDate"
  16.         sql = sql & " FROM UC_B2B where(1=1) and isnull(cB2BFileName,'')='' and cBGName='" & ComboBox1.Text & "'"


  17.         If TextBox1.Text <> "" Then sql = sql & " and cCode like '%" & TextBox1.Text & "%'"
  18.         sql = sql & " and dDate>='" & DateTimePicker1.Text & "' and dDate<='" & DateTimePicker2.Text & "'"
  19.         sql = sql & " order by id"
  20.         Dim cmd1 As SqlCommand = New SqlCommand(sql, sqledi)

  21.         dataAdapter.SelectCommand = cmd1


  22.         dataAdapter.Fill(dst, "B2B")
  23.         dt = dst.Tables("B2B")

  24.         sqledi.Close()

  25.         DataGridView1.AutoGenerateColumns = True
  26.         DataGridView1.DataSource = dt


阅读(1591) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~