Dim DBConn As New SqlConnection("Server=192.168.1.2;User ID=sa;Password=Tespa01;DataBase=TespaMechanical")
Dim DBCmd As New SqlCommand
Dim DBAdap As New SqlDataAdapter
Dim DS As New DataSet
Dim tbl As DataTable
Dim dr As DataRow
Dim st As String = "Leverdial"
Dim i As Integer
Dim strsql As String = "SELECT CustName,WINo,DateofCalib,CustomerRef,OurRef,CalibOnReceipt,UUTName,Make,reqby,IDRef,Description,Temperature,Humidity,Calibby,Remarks1,slno,traceability,range,leastcount,datathrough,expunc,kfactor FROM TI_Calibdata where UniqueID=' " & selectedid & " ' and CalibInstrumentType='" & st & "'"
DBConn.Open()
Try
DBCmd = New SqlCommand(strsql, DBConn)
DBCmd.ExecuteNonQuery()
DBAdap = New SqlClient.SqlDataAdapter(strsql, DBConn)
DBAdap.Fill(DS)
tbl = DS.Tables("TI_Calibdata")
dr = DS.Tables(0).Rows(0)
ComboBox15.Text = dr.Item("CustName")
ComboBox1.Text = dr.Item("WINo")
TextBox1.Text = dr.Item("DateofCalib")
TextBox2.Text = dr.Item("CustomerRef")
TextBox18.Text = dr.Item("OurRef")
ComboBox5.Text = dr.Item("CalibOnReceipt")
ComboBox3.Text = dr.Item("UUTName")
ComboBox4.Text = dr.Item("Make")
ComboBox8.Text = dr.Item("reqby")
TextBox21.Text = dr.Item("IDRef")
ComboBox2.Text = dr.Item("Description")
TextBox6.Text = dr.Item("Temperature")
TextBox7.Text = dr.Item("Humidity")
ComboBox6.Text = dr.Item("Calibby")
TextBox17.Text = dr.Item("Remarks1")
TextBox4.Text = dr.Item("slno")
ComboBox16.Text = dr.Item("traceability")
TextBox3.Text = dr.Item("range")
TextBox5.Text = dr.Item("leastcount")
ComboBox7.Text = dr.Item("datathrough")
TextBox20.Text = dr.Item("expunc")
TextBox19.Text = dr.Item("kfactor")
Catch exp As Exception
MsgBox(exp.Message, MsgBoxStyle.Information)
End Try
DBConn.Close()
DBConn = Nothing