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. Database & SysAdmin
  3. Database
  4. Adding a new row

Adding a new row

Scheduled Pinned Locked Moved Database
helpcsharpdatabasequestionannouncement
2 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.
  • G Offline
    G Offline
    goldoche
    wrote on last edited by
    #1

    Hi, I have a problem creating a new row in my first database project, using ADO .NET. When I remove the call to AddSummaryRow, UpdateDatabase yields no error, but when it's there, I get an System.Format Exception "Input string was not in a correct format". Do you guys have any idea of what the problem is? private void UpdateCurrentRow() { currentRow = acp2DataSet.Summary.FindBySerial_Number(serialNumber); if(currentRow == null) { acp2DataSet.Summary.AddSummaryRow("None", "Unassigned", serialNumber); UpdateDatabase(); } } public void UpdateDatabase() { acp2DataAdapter.Update(acp2DataSet.Summary); }

    K 1 Reply Last reply
    0
    • G goldoche

      Hi, I have a problem creating a new row in my first database project, using ADO .NET. When I remove the call to AddSummaryRow, UpdateDatabase yields no error, but when it's there, I get an System.Format Exception "Input string was not in a correct format". Do you guys have any idea of what the problem is? private void UpdateCurrentRow() { currentRow = acp2DataSet.Summary.FindBySerial_Number(serialNumber); if(currentRow == null) { acp2DataSet.Summary.AddSummaryRow("None", "Unassigned", serialNumber); UpdateDatabase(); } } public void UpdateDatabase() { acp2DataAdapter.Update(acp2DataSet.Summary); }

      K Offline
      K Offline
      Karma31251
      wrote on last edited by
      #2

      Sounds like you have an data type error. It mihgt be that your trying to input a double, or decimal, or other number format into a string or vise versa. Make sure that your inputs are the same data type as method your inputing them into. Example: Private void UpdateRow(argument1 as string) you cant input an integer as argument1 because its supposed to be a string.

      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