SqlDataReader的使用
Try Dim DR As SqlDataReader DR = CL.SelectSqldr("SELECT * FROM LJWK001H WHERE uid=" & V_UID) If DR.HasRows Then While DR.Read Me.TB_WKNO.Text = DR("wk_no").ToString Me.TB_WKNAME.Text = DR("wk_name").ToString Me.TB_RMK.Text = DR("rmk").ToString Me.CB_WKENDAUTO.Checked = DR("wk_endauto") Me.TB_WKENDAUTOMM.Text = DR("wk_endautomm").ToString Me.CB_WKJG.Checked = DR("wk_jg") Me.CB_TIMEC.Checked = DR("wk_timec") Me.TB_TIMEC.Text = DR("wk_timecqty").ToString Me.TB_WKYIELD.Text = DR("wk_yield").ToString Me.CB_WKJG2.Checked = DR("wk_jg2") Me.CB_WKSTATE.Checked = DR("wk_state") Me.CB_WKQTYCONTROL.Checked = DR("wk_qtycontrol") End While End If If DR.IsClosed = False Then DR.Close() Catch ex As Exception MessageBox.Show(Err.Description) End Try Me.TB_SCPRID.Text = "" Me.TB_DPNO.Text = "" Me.TB_ELNO.Text = "" Me.TB_WKNO.Text = "" If Me.TB_SCPRNO.Text <> "" Then If MA008H.Isexists(" LJWK006H (NOLOCK) ", " sc_prno='" & Me.TB_SCPRNO.Text & "'") = False Then MsgBox("工令单不存在", MsgBoxStyle.Exclamation, "Message") Me.TB_SCPRNO.Focus() Me.TB_SCPRNO.SelectAll() Exit Sub Else End If End If