Data Source SAI/SQLEXPRESS Initial Catalog Cancer Integrated Security True
Data Source SAI/SQLEXPRESS Initial Catalog Cancer Integrated Security True
SqlClient
Imports System.IO
Public Class imagecompare
Dim con As New SqlConnection("Data Source=SAI\SQLEXPRESS;Initial
Catalog=cancer;Integrated Security=True")
Dim com As New SqlCommand
Dim adp As New SqlDataAdapter
Dim ds As DataSet
Dim qry As String
Dim i As Integer
Dim j As Integer
Dim fn As String
Dim p As String
con.Open()
con.Close()
Catch ex As Exception
Form7.Show()
'Me.Hide()
'MsgBox(" Invalid Register No Select Correct Register Number")
End Try
Try
con.Open()
con.Close()
Catch ex As Exception
Form7.Show()
'Me.Hide()
'MsgBox(" Invalid Register No Select Correct Register Number")
End Try
Try
qry = "select cid,cname,cdesc,pname from cancer1 where imgloc='"
+ TextBox5.Text + "'"
com = New SqlCommand(qry, con)
adp = New SqlDataAdapter(com)
ds = New DataSet
adp.Fill(ds, "cancer1")
TextBox1.Text = ds.Tables("cancer1").Rows(0)(0)
TextBox2.Text = ds.Tables("cancer1").Rows(0)(1)
TextBox3.Text = ds.Tables("cancer1").Rows(0)(2)
TextBox4.Text = ds.Tables("cancer1").Rows(0)(3)
'Txt_nation.Text = ds.Tables("newuserl").Rows(0)(10)
'Txt_DOJ.Text = ds.Tables("newuser").Rows(0)(11)
Catch ex As Exception
End Try
Try
qry = "select * from food where cid='" + TextBox1.Text + "'"
com = New SqlCommand(qry, con)
adp = New SqlDataAdapter(com)
ds = New DataSet
adp.Fill(ds, "food")
TextBox6.Text = ds.Tables("food").Rows(0)(3)
'Txt_nation.Text = ds.Tables("newuserl").Rows(0)(10)
'Txt_DOJ.Text = ds.Tables("newuser").Rows(0)(11)
Catch ex As Exception
End Try
Try
qry = "select * from medicine where cid='" + TextBox1.Text + "'"
com = New SqlCommand(qry, con)
adp = New SqlDataAdapter(com)
ds = New DataSet
adp.Fill(ds, "medicine")
TextBox7.Text = ds.Tables("medicine").Rows(0)(0)
TextBox8.Text = ds.Tables("medicine").Rows(0)(4)
TextBox9.Text = ds.Tables("medicine").Rows(0)(1)
TextBox10.Text = ds.Tables("medicine").Rows(0)(5)
'Txt_nation.Text = ds.Tables("newuserl").Rows(0)(10)
'Txt_DOJ.Text = ds.Tables("newuser").Rows(0)(11)
Catch ex As Exception
End Try
Try
qry = "select * medicine where mid='" + TextBox7.Text + "'"
com = New SqlCommand(qry, con)
adp = New SqlDataAdapter(com)
ds = New DataSet
adp.Fill(ds, "medicine")
'TextBox7.Text = ds.Tables("medicine").Rows(0)(0)
TextBox8.Text = ds.Tables("medicine").Rows(0)(4)
TextBox9.Text = ds.Tables("medicine").Rows(0)(1)
TextBox10.Text = ds.Tables("medicine").Rows(0)(5)
'Txt_nation.Text = ds.Tables("newuserl").Rows(0)(10)
'Txt_DOJ.Text = ds.Tables("newuser").Rows(0)(11)
Catch ex As Exception
End Try
End Sub
End Class
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
TextBox5.Text = ""
TextBox6.Text = ""
End Sub
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
Try
Dim p As String
str = "select mid from medicine"
com = New SqlCommand(str, con)
adp = New SqlDataAdapter(com)
ds = New DataSet
adp.Fill(ds, "medicine")
i = ds.Tables("medicine").Rows.Count
p = ds.Tables("medicine").Rows(i - 1)(0)
p = Mid(p, 4)
p = Val(p) + 1
'If Len(p) = 1 Then
' p = "000" + p
'ElseIf Len(p) = 2 Then
' p = "00" + p
'ElseIf Len(p) = 3 Then
' p = "0" + p
'End If
TextBox1.Text = "MED" + p
Catch ex As Exception
TextBox1.Text = "MED1"
End Try
End Sub