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
narasiman rao
NA
519
769.2k
how to update the command using oledb in csharp in windows
Feb 14 2013 8:49 AM
how to update the command using oledb in csharp in windows application.
Faculty code textbox
Faculty Name textbox
Allocated hours textbox
Save code as follows;
private Globalfunction GFun = new Globalfunction();
private string sql;
sql = "insert into Tb_Faculty_Details ([Faculty_Code], [Faculty_Name],[Allocated_Hours]) " + " values('" + txt_Faccode.Text + "','" + Txt_Facname.Text + "', " + txt_Hrs.Text + ")";
try
{
GFun.error = "";
GFun.InsertAccessData(sql);
if (GFun.error.ToString() != "")
{
MessageBox.Show(GFun.error.ToString(), "Error");
return;
}
GFun.OleDbcon.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
Update code as follows;
sql = "Update Tb_Faculty_Details set (Allocate_hours = '" + txt_Hrs.Text + "') where Faculty_Code = ' " + txt_Faccode.Text + "'";
try
{
GFun.error = "";
GFun.InsertAccessData(sql);
if (GFun.error.ToString() != "")
{
MessageBox.Show(GFun.error.ToString(), "Error");
return;
}
GFun.OleDbcon.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
i want to update only allocated hours after searching the record, i want to update the allocated hours.
Reply
Answers (
1
)
Ms Word doc as OLE Object
Moving cursor to beginning of document - C# and Word Interop