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
Snehal Bobde
NA
11
20.4k
Problem in update
Jan 4 2012 1:33 AM
try
{
OleDbConnection con = new OleDbConnection(ConnectionString);
con.Open();
string s1 = dtp_date.Value.ToShortDateString();
OleDbCommand cmd = new OleDbCommand("update dbo_Diesel_Master set Petrol_pump_name='" + txt_Petrl_pump_name.Text + "',Vehicle_No='" + cmb_VehicleNo.Text + "',Fuel='" + txt_Fuel.Text + "',Rate='" + txt_rate.Text + "',Date='" + s1 + "',Challan_No='" + txt_challan_no.Text + "',Amount='" + txt_amt.Text + "' where Petrol_pump_name='" + DGV_Diesel.SelectedRows[0].Cells[0].Value + "'", con);
cmd.ExecuteNonQuery();
cmd = new OleDbCommand("select * from dbo_Diesel_Master", con);
dr = cmd.ExecuteReader();
DataTable dt = new DataTable();
dt.Load(dr);
DGV_Diesel.DataSource = dt;
MessageBox.Show("updated successfully.....");
con.Close();
}
catch (Exception ex)
{
MessageBox.Show("please select a record for delete..");
}
Reply
Answers (
5
)
Yet another problem with LOOPS
How can we call method through property ?