hi im new here need help for my project
heres my problem:
i have 4 data to be save
but
if 2 out of 4 data are already in my data base i need to
re entry my data..
pls help me..
heres my code
cmd = con.CreateCommand()
cmd.CommandType = CommandType.Text
cmd.CommandText = "Select * from tblschedule where room like '%" & TextBox2.Text & "%' or teacher LIKE '%" & TextBox4.Text & "%'"
cmd = New SqlCommand(cmd.CommandText, con)
i = cmd.ExecuteNonQuery()
Dim sda As SqlDataAdapter = New SqlDataAdapter(cmd)
Dim dt As DataTable = New DataTable()
sda.Fill(dt)
If (dt.Rows.Count > 0) Then
MsgBox("Room Name Already Exist", MessageBoxIcon.Error, "Error")
heres my problem:
i have 4 data to be save
but
if 2 out of 4 data are already in my data base i need to
re entry my data..
pls help me..
heres my code
cmd = con.CreateCommand()
cmd.CommandType = CommandType.Text
cmd.CommandText = "Select * from tblschedule where room like '%" & TextBox2.Text & "%' or teacher LIKE '%" & TextBox4.Text & "%'"
cmd = New SqlCommand(cmd.CommandText, con)
i = cmd.ExecuteNonQuery()
Dim sda As SqlDataAdapter = New SqlDataAdapter(cmd)
Dim dt As DataTable = New DataTable()
sda.Fill(dt)
If (dt.Rows.Count > 0) Then
MsgBox("Room Name Already Exist", MessageBoxIcon.Error, "Error")