Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. SQL Server Update Problem

SQL Server Update Problem

Scheduled Pinned Locked Moved Visual Basic
databasehelpcsharpsql-server
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Drew
    wrote on last edited by
    #1

    I have a very weird problem. I'll try to be specific, but I'm just beginning VB.NET programming. I built a SQL Server 2005 database from the ground up. Currently I'm building a front-end in VB.NET. I'm using a Janus GridEX 2 to make a hierarchy of projects, assemblies, and parts. For some reason, the projects and assemblies update fine, but the parts and "Assemblies to Assemblies" (used to make nearly infinate levels of hierarchy) tables create an error saying it can't update the Id. The Id is required to make the program work, so I can't just remove it. The first two lines work. The last two do not. Me.ProjectTableAdapter.Update(Me.ProjPurch2005DataSet.Project) Me.AssemblyTableAdapter.Update(Me.ProjPurch2005DataSet._Assembly) Me.Assy2AssyTableAdapter.Update(Me.ProjPurch2005DataSet.Assy2Assy) Me.PurchaseTableAdapter.Update(Me.ProjPurch2005DataSet.Purchase) Is there a blatent reason that I'm just not seeing? :confused:

    D 1 Reply Last reply
    0
    • D Drew

      I have a very weird problem. I'll try to be specific, but I'm just beginning VB.NET programming. I built a SQL Server 2005 database from the ground up. Currently I'm building a front-end in VB.NET. I'm using a Janus GridEX 2 to make a hierarchy of projects, assemblies, and parts. For some reason, the projects and assemblies update fine, but the parts and "Assemblies to Assemblies" (used to make nearly infinate levels of hierarchy) tables create an error saying it can't update the Id. The Id is required to make the program work, so I can't just remove it. The first two lines work. The last two do not. Me.ProjectTableAdapter.Update(Me.ProjPurch2005DataSet.Project) Me.AssemblyTableAdapter.Update(Me.ProjPurch2005DataSet._Assembly) Me.Assy2AssyTableAdapter.Update(Me.ProjPurch2005DataSet.Assy2Assy) Me.PurchaseTableAdapter.Update(Me.ProjPurch2005DataSet.Purchase) Is there a blatent reason that I'm just not seeing? :confused:

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      `Drew wrote:

      create an error saying it can't update the Id.

      The Data and Table adapter require that the table's they are working on have primary keys. If your table doesn't have one, you can't do any updating of the tables until you put one in and update the DataAdpter or TableAdapter SQL statements to return that key field in the query results. ...or did I miss something in your post??

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007

      D 1 Reply Last reply
      0
      • D Dave Kreskowiak

        `Drew wrote:

        create an error saying it can't update the Id.

        The Data and Table adapter require that the table's they are working on have primary keys. If your table doesn't have one, you can't do any updating of the tables until you put one in and update the DataAdpter or TableAdapter SQL statements to return that key field in the query results. ...or did I miss something in your post??

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
             2006, 2007

        D Offline
        D Offline
        Drew
        wrote on last edited by
        #3

        Is an IDENTITY column the same as a primary key?

        D 1 Reply Last reply
        0
        • D Drew

          Is an IDENTITY column the same as a primary key?

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          Nope. Far from it. Read[^]

          A guide to posting questions on CodeProject[^]
          Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
               2006, 2007

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups