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
Ilkin East
NA
100
174.3k
Excel
Apr 29 2012 2:24 AM
Hi,
I want to insert data from my application to existing excel file.When I try I get error message <Operation must use an updateable query>.
My code :
public void button2_Click(object sender, EventArgs e)
{
OleDbConnection con;
OleDbCommand com = new OleDbCommand();
string sql = null;
con = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + op.FileName + ";Extended Properties='Excel 12.0 Xml;HDR=YES';");
con.Open();
com.Connection = con;
sql = "Insert into [Sheet1$] (Name,Surname,PC) Values ('Jack','Nana','9')";
com.CommandText = sql;
com.ExecuteNonQuery();
con.Close();
}
Thanks In advance
Reply
Answers (
1
)
To provide image path in winforms application
Visual Basic 2010 : Working with Advantech PIC 1710 as Data Acqusition System & Build Database for Battery Voltage and Current