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
soonhuat81
NA
31
0
Update Error - Please
Jun 24 2004 5:46 AM
I have a datagrid(with the column ProductID and etc) onto my form(form1) ... I also have all the same field in textedit/lookupedit format corresponding to each of the column in datagrid...and here is how i do the binding.. DataGrid - Bind its datasource to DataTableOrderDetail lookupeditProductID - This lookupedit will get the data from another table call "PRODUCT" and the following is how i bind it: lookupeditProductID.DataBindings.Add(new System.Windows.Forms.Binding("EditValue", DataTableOrderDetail;"ProductID")); lookupeditProductID.Properties.DataSource = DataTableProduct; lookupeditProductID.Properties.DisplayMember = "Description"; lookupeditProductID.Properties.ValueMember = "ProductID"; The system is work fine each time i locate the new ProductID from DataTableProdct .. but after i have edit and change the data for lookupeditProductID field and Save it, the following error message prompt out .. "An unhandled exception of type 'System.InvalidOperationException' occurred in system.data.dll Additional information: Dynamic SQL generation for the UpdateCommand is not supported against a SelectCommand that does not return any key column information." For your info, here i the code i write for the Save function: SqlConnection aconnect = new SqlConnection(myConnectionString); aconnect.Open(); SqlCommand aCmd = new SqlCommand("SELECT * FROM OrderDetail", aconnect); SqlDataAdapter sqlDataAdapter1 = new SqlDataAdapter(aCmd); SqlCommandBuilder aCmdBuilder = new SqlCommandBuilder(sqlDataAdapter1); sqlDataAdapter1.Update(DataTableOrderDetail); aconnect.Close(); What's wrong with my code ?? I hope some one can help as this is in urgent thanks.
Reply
Answers (
1
)
How to add new element to xml ,VB.net
pasing data between forms and dialog boxes