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
Administrator
Tech Writer
2.2k
1.5m
problem insert into access DB
Mar 7 2003 4:50 PM
Hi I'm trying to insert into access DB this data using this code is any one can explain what is wrong with this code ???? the code : --------------------------------------------------------------------------------------- OleDbConnection connection = new OleDbConnection(strDBConn); OleDbTransaction transaction; String sql = "INSERT INTO TblProjects (field1, field2, field3, field4, field5)" + " VALUES ('" + txtbx_ProjectName.Text + "','" + ddlst_SystemsType.SelectedItem.Text + "','" + ddlst_Versions.SelectedItem.Text + "','" + ddlst_Tester.SelectedItem.Text + "','" + ddlst_ProjectManager.SelectedItem.Text + "');"; connection.Open(); transaction = connection.BeginTransaction(); st = sql; OleDbCommand commmand = new OleDbCommand(sql, connection); commmand.CommandType = CommandType.Text; commmand.Transaction = transaction; commmand.ExecuteNonQuery(); transaction.Commit(); connection.Close(); Response.Redirect("aspPage.aspx"); --------------------------------------------------------------------------------------- the exception is : Operation must use an updateable query. --------------------------------------------------------------------------------------- the SQL is: INSERT INTO TblProjects (field1, field2, field3, field4, field5) VALUES ('aaa','bbb','ccc','ddd','eee');
Reply
Answers (
10
)
Can I access specific columns and create a dataset ?
GetChanges problem!!