Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 15484

VS 2008 re entry data

$
0
0
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")

Viewing all articles
Browse latest Browse all 15484

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>