TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
mash alyy
NA
12
6.7k
Delete particular record by checking records in access db 2007
Jul 29 2012 2:41 AM
Hi.
I want to delete a particular record from the access db 2007, the below code is working fine but whether record existing or not its just saying record deleted.
But I don't want that, It shud check whether record exists or not, if exist then shud delete the record otherwise shud say "No record found".
My code::
Dim con As OleDbConnection
Dim com As OleDbCommand
con = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & System.Environment.CurrentDirectory & "\MQIB.mdb")
com = New OleDbCommand("delete from Books where BookSerial
=@bsno
", con)
con.Open()
com.Parameters.AddWithValue("@bsno", Integer.Parse(txtBS.Text))
com.ExecuteNonQuery()
MsgBox("Record Deleted")
con.Close()
Plz help me out.
Reply
Answers (
0
)
I have a problem for ini File
How to create Id cards using c#