Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 2005 > Pro Visual Basic 2005
| Search | Today's Posts | Mark Forums Read
Pro Visual Basic 2005 For advanced Visual Basic coders working in version 2005. Beginning-level questions will be redirected to other forums, including Beginning VB 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro Visual Basic 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 16th, 2008, 12:05 PM
Registered User
 
Join Date: Dec 2007
Location: Surfside Beach, SC, USA.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to ksamuel
Default (Resolved) TableAdapter Error

Im building an application that connects to a SQL Server. I have a datagrid on the form and when I make a change to the data and try to clikc the save command on the form, I get the following error:

InvalidOperationException was unhandled


code:

Public Class Form1

    Private Sub MainDataBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MainDataBindingNavigatorSaveItem.Click
        Me.Validate()
        Me.MainDataBindingSource.EndEdit()
        Me.MainDataTableAdapter.Update(Me.HRPCTSDataSet.Ma inData)

    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'TODO: This line of code loads data into the 'HRPCTSDataSet.MainData' table. You can move, or remove it, as needed.
        Me.MainDataTableAdapter.Fill(Me.HRPCTSDataSet.Main Data)

    End Sub
End Class
 
Old January 16th, 2008, 01:03 PM
Registered User
 
Join Date: Dec 2007
Location: Surfside Beach, SC, USA.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to ksamuel
Default

I feel real silly. I didn't define my primary key in my table on SQL Server.





Similar Threads
Thread Thread Starter Forum Replies Last Post
TableAdapter nkrust ASP.NET 2.0 Basics 2 May 14th, 2011 08:12 AM
[Resolved] Error: File used by another process snufse .NET Framework 2.0 2 February 18th, 2008 09:20 AM
[Resolved] Error calling a sp - parameter error snufse .NET Framework 2.0 2 February 12th, 2008 04:46 PM
chapter 2, error uri cannot be resolved in either boylevel BOOK: Beginning JavaServer Pages 2 November 21st, 2007 12:54 PM
TableAdapter ahamilto Pro VB Databases 0 January 24th, 2006 03:21 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.