Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 2005 > Pro Visual Basic 2005
Password Reminder
Register
Register | FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Display Modes
  #1 (permalink)  
Old January 16th, 2008, 11:05 AM
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
  #2 (permalink)  
Old January 16th, 2008, 12: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.

 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 08:20 AM
[Resolved] Error calling a sp - parameter error snufse .NET Framework 2.0 2 February 12th, 2008 03:46 PM
chapter 2, error uri cannot be resolved in either boylevel BOOK: Beginning JavaServer Pages 2 November 21st, 2007 11:54 AM
TableAdapter ahamilto Pro VB Databases 0 January 24th, 2006 02:21 PM



All times are GMT -4. The time now is 11:00 AM.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.