Home > Software engineering >  Questions about the datatable data transfer line column
Questions about the datatable data transfer line column

Time:09-22

This is a VB data row column, haven't contact with VB is really don't understand, who can help me to c # or explain greatly, about the operation of the process,
Thanks!
 Private Sub BindData () 
Dim STRSQL As String=""
Dim As dt System. Data. DataTable
Try
Dim d1 As DateTime=DateTime. Parse (txtEndTime. Text)
Dim d2 As DateTime=DateTime. Parse (txtStartTime. Text)
Dim d As String="0"
Me. LblErrMsg. Text=""
If an Integer. The Parse (Math. Abs (DateDiff (" d ", d1, d2))) & gt; 7 Then
Me. LblErrMsg. Text="The Inteval between Start Time and End Time should In 7 Days"
Return
End the If

STRSQL="Select Distinct Bincode from DA_FCA_GOODBIN_TBL Where 1=1"
If txtCust. Text & lt;> "" Then
STRSQL=STRSQL + "And the Customer like '%" + txtCust. Text. Trim. ToUpper + "%'"
End the If
If txtWaferLot. Text & lt;> "" Then
STRSQL=STRSQL + "And WAFERLOTNO='" + txtWaferLot. Text +"' "
End the If
If txtAssyLot. Text & lt;> "" Then
STRSQL=STRSQL + "And ASSYLOTID='" + txtAssyLot. Text +"' "
End the If
If txtWaferID. Text & lt;> "" Then
STRSQL=STRSQL + "And WAFERID='" + txtWaferID. Text +"' "
End the If
If txtStartTime. Text & lt;> "" Then
STRSQL=STRSQL + "And SCANTIME & gt; To_date (' 00:00:00 "+ txtStartTime. Text +" ', 'YYYY/MM/DD HH24: MI: SS')
"End the If
If txtEndTime. Text & lt;> "" Then
STRSQL=STRSQL + "And SCANTIME & lt; To_date (" "+ txtEndTime. Text +" 23:59:59 ', 'YYYY/MM/DD HH24: MI: SS')
"End the If

Dim newdt As the New System. The Data. The DataTable
If WebDB. Create_DB (mDB, mErrMsg) Then
If the mDB. Execute (STRSQL, dt) Then
If Not IsNothing (dt) OrElse dt. Rows. Count & gt; 0 Then

Dim newdtCol1 As the New System. Data. DataColumn (" CUSTOMER ", the GetType (" System. The String "))
Dim newdtCol2 As the New System. Data. DataColumn (" CUST_DEVICE ", the GetType (" System. The String "))
Dim newdtCol3 As the New System. Data. DataColumn (" ASSY_LOTID ", the GetType (" System. The String "))
Dim newdtCol4 As the New System. Data. DataColumn (" WAFER_LOTNO ", the GetType (" System. The String "))
Dim newdtCol5 As the New System. Data. DataColumn (" WAFERID ", the GetType (" System. The String "))
Dim newdtCol6 As the New System. Data. DataColumn (" SCANTIME ", the GetType (" System. A DateTime "))
Dim newdtCol7 As the New System. Data. DataColumn (" EMPOLYEEID ", the GetType (" System. The String "))
Dim newdtCol8 As the New System. Data. DataColumn (" few ", the GetType (" System. The String "))

Dim newdtCol9 As the New System. Data. DataColumn (" TOTALSIZE_AUTO ", the GetType (" System. The String "))
Dim newdtCol10 As the New System. Data. DataColumn (" TOTALSIZE_MANUAL ", the GetType (" System. The String "))

Newdt. Columns. The Add (newdtCol1)
Newdt. Columns. The Add (newdtCol2)
Newdt. Columns. The Add (newdtCol3)
Newdt. Columns. The Add (newdtCol4)
Newdt. Columns. The Add (newdtCol5)
Newdt. Columns. The Add (newdtCol6)
Newdt. Columns. The Add (newdtCol7)
Newdt. Columns. The Add (newdtCol8)
Newdt. Columns. The Add (newdtCol9)
Newdt. Columns. The Add (newdtCol10)

Me. GvData. Columns. The Clear ()
GenerateGVCol (" CUSTOMER ", "50")
GenerateGVCol (" CUST_DEVICE ", "80")
GenerateGVCol (" ASSY_LOTID ", "50")
GenerateGVCol (" WAFER_LOTNO ", "50")
GenerateGVCol (" WAFERID ", "50")
GenerateGVCol (" SCANTIME ", "80")
GenerateGVCol (" EMPOLYEEID ", "50")
GenerateGVCol (" few ", "50")
GenerateGVCol (" TOTALSIZE_AUTO ", "20")
GenerateGVCol (" TOTALSIZE_MANUAL ", "20")

For I As Integer=0 To dt. Rows. The Count - 1
'Dim newdtCol As the New System. The Data. The DataColumn (" BINCODE_ "+ dt. Rows (I) (0). The ToString, the GetType (" System. The String"))
'newdt. Columns. The Add (newdtCol)
Dim newdtCol_1 As the New System. Data. DataColumn (" BINCODE_ "+ dt. Rows (I) (0). The ToString +" _AUTOQTY ", the GetType (" System. The String "))
Newdt. Columns. The Add (newdtCol_1)
Dim newdtCol_2 As the New System. Data. DataColumn (" BINCODE_ "+ dt. Rows (I) (0). The ToString +" _MANQTY ", the GetType (" System. The String "))
Newdt. Columns. The Add (newdtCol_2)

GenerateGVCol (newdtCol_1 ColumnName, "30")
GenerateGVCol (newdtCol_2 ColumnName, "30")
Next

The Else
Me. LblErrMsg. Text="Can not find the Data"
Return
End the If
End the If

STRSQL="Select * from DA_FCA_GOODBIN_TBL Where 1=1"
If txtCust. Text & lt;> "" Then
STRSQL=STRSQL + "And the Customer like '%" + txtCust. Text. Trim. ToUpper + "%'"
End the If
If txtWaferLot. Text & lt;> "" Then
STRSQL=STRSQL + "And WAFERLOTNO='" + txtWaferLot. Text +"' "
End the If
If txtAssyLot. Text & lt;> "" Then
STRSQL=STRSQL + "And ASSYLOTID='" + txtAssyLot. Text +"' "
End the If
If txtWaferID. Text & lt;> "" Then
STRSQL=STRSQL + "And WAFERID='" + txtWaferID. Text +"' "
End the If
If txtStartTime. Text & lt;> "" Then
STRSQL=STRSQL + "And SCANTIME & gt; To_date (' 00:00:00 "+ txtStartTime. Text +" ', 'YYYY/MM/DD HH24: MI: SS')
"End the If
If txtEndTime. Text & lt;> "" Then
STRSQL=STRSQL + "And SCANTIME & lt; To_date (" "+ txtEndTime. Text +" 23:59:59 ', 'YYYY/MM/DD HH24: MI: SS')
"End the If
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related