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
Atul Rokade
NA
141
43.8k
update query executed but record not updated
Feb 16 2017 1:36 PM
Hi all,
Iam doing one task where i want to executed update query i have table name is Medicine_Available_Detail here iam storing total medicine available column name is Availability,I have one datagridview where im putting Quantity of that Medicine after user enter
Quantity of particular medicine then it table update as Availability-Quantity for that medicine i written a code but its executed but record not updated
private void dataGridView1_RowLeave(object sender, DataGridViewCellEventArgs e)
{
int quantity = Convert.ToInt16(dataGridView1.Rows[e.RowIndex].Cells["Quantity"].Value);
cmd = new OleDbCommand("update Medicine_Available_Detail set [Availability]=[Availability]-@Quantity where [Medicine_Name]=@Medicine_Name", con);
cmd.Parameters.AddWithValue("@Quantity", quantity);
cmd.Parameters.AddWithValue("@Medicine_Name", medicinename);
con.Open();
int n = cmd.ExecuteNonQuery();
con.Close();
}
Reply
Answers (
4
)
add new column in VSTS
which dll need to put on server bin to fix Microsoft.ACE.OLE