msvisual.com Forum Index
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

VB 2005 question

 
Post new topic   Reply to topic    msvisual.com Forum Index -> VB Syntax
Author Message
Charlie Mac



Joined: 04 Oct 2007
Posts: 4

PostPosted: Mon Nov 13, 2006 10:21 pm    Post subject: VB 2005 question Reply with quote

I am trying to use the BindingNavigator (using VB 2005) to update five
tables (one at a time) depicted in five DataGridViews (one table on
each TabPage). Each table loads into its DataGridView properly. The
"MyEray" table will update but all others receive this message when
trying to save:

InvalidOperationException was unhandled
Update requires a valid UpdateCommand when passed DataRow collection
with modified rows.

Please help. This is my code:

Option Explicit On
Option Strict On
Public Class Form1

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Me.EAdataDataSet.EnforceConstraints = False
Me.MyArayTableAdapter.Fill(Me.EAdataDataSet.MyAray)
Me.MyBrayTableAdapter.Fill(Me.EAdataDataSet.MyBray)
Me.MyCrayTableAdapter.Fill(Me.EAdataDataSet.MyCray)
Me.MyDrayTableAdapter.Fill(Me.EAdataDataSet.MyDray)
Me.MyErayTableAdapter.Fill(Me.EAdataDataSet.MyEray)
Me.MyFrayTableAdapter.Fill(Me.EAdataDataSet.MyFray)
End Sub

Private Sub MyErayBindingNavigatorSaveItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
MyErayBindingNavigatorSaveItem.Click
Me.Validate()
Select Case TabControl1.SelectedIndex
Case 0
Me.MyErayBindingSource.EndEdit()
Me.MyErayTableAdapter.Update(Me.EAdataDataSet.MyEray)
Case 1
Me.MyBrayBindingSource.EndEdit()
Me.MyBrayTableAdapter.Update(Me.EAdataDataSet.MyBray)
Case 2
Me.MyCrayBindingSource.EndEdit()
Me.MyCrayTableAdapter.Update(Me.EAdataDataSet.MyCray)
Case 3
Me.MyArayBindingSource.EndEdit()
Me.MyArayTableAdapter.Update(Me.EAdataDataSet.MyAray)
Case 4
Me.MyDrayBindingSource.EndEdit()
Me.MyDrayTableAdapter.Update(Me.EAdataDataSet.MyDray)
Case 5
Me.MyFrayBindingSource.EndEdit()
Me.MyFrayTableAdapter.Update(Me.EAdataDataSet.MyFray)
End Select
End Sub

Archived from group: microsoft>public>vb>syntax
Back to top
View user's profile Send private message
Charlie Mac



Joined: 04 Oct 2007
Posts: 4

PostPosted: Mon Nov 13, 2006 10:26 pm    Post subject: Re: VB 2005 question Reply with quote

Sorry. I posted this in the wrong group.

Back to top
View user's profile Send private message
Display posts from previous:   
Related Topics:
VB 2005 - Binding Source question VB Gerus, I am new to VB 2005 and am receiving the "Update requires a valid UpdateCommand when passed DataRow collection with modified rows." message tied to the TableAdapter line when trying to save data modified in a DataGridView. MyEray is the table n

Visual Basic Xpress 2005 Code Help I am trying to get some code that will go into Active Directory and extract the attribute for every user in a domain. I know nothing about VB, so I would like help with fixing the error below. My only programming experience prior to thi

VB 2005 variable declarations and method calls Hi, I'm moving from VB6 to VB 2005. Two questions: 1. One book I'm using has syntax like Dim as SqlConnection = New However, the Help for the Dim statement says, "If you use New, you do not use an initializer

help on this question Given the function (FullFileName as string) as string, write the statements necessary to return just the file name.

Another API Question I have this lonStatus = strCmdLine, _ 0#, 0#, 1, &H40, 0&, workpath, But what exactly are 0#, 0#, &H40, 0& doing? I don't get it Thanks Adamb
Post new topic   Reply to topic    msvisual.com Forum Index -> VB Syntax All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group