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
Jyoti Jodha
NA
1.7k
408.5k
How to before delete records check in two tables same field
Sep 16 2017 5:21 AM
How to before delete records check in two tables same field name c#
i want to before delete check in two tables "MainBillForm" and "suppliers_Form"
if (Product_ID != 0)
{
cmd = new SqlCommand("IF NOT EXISTS(SELECT Product_Name FROM MainBillForm,suppliers_Form WHERE Product_Name = '" + Product_ID + "')delete Product where Product_ID=@id", con);
con.Open();
cmd.Parameters.AddWithValue("@id", Product_ID);
btn_Insert.Text = "Save";
int k = cmd.ExecuteNonQuery();
con.Close();
if (k > 0)
{
MessageBox.Show("Record Deleted Successfully!");
}
else
{
MessageBox.Show("Product is Already used in Bill So you don't Deleted this Product !");
}
Reply
Answers (
10
)
how to check datagridview cell is empty in c# windows forms
Please my datagridview is blinking in c# windows form