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. C#
  4. Totally Beginner Question.. Updating SQL Server DB.

Totally Beginner Question.. Updating SQL Server DB.

Scheduled Pinned Locked Moved C#
databasequestionsql-serversysadminhelp
3 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.
  • H Offline
    H Offline
    HopefulCoder
    wrote on last edited by
    #1

    Why does this not work.. im sure the syntax isnt right, but what should it be.. im trying to refference text boxes in a form... this.tblInvoiceTableAdapter.UpdateQuery(owner_NameTextBox,owner_AddressTextBox,owner_CityTextBox,owner_StateTextBox,owner_ZipTextBox); the error is simply "Error 2 Argument '1': cannot convert from 'System.Windows.Forms.TextBox' to 'string' " I have tried the ".tostring" thing, no luck. Sorry for the stupid question, im just starting out.

    X 1 Reply Last reply
    0
    • H HopefulCoder

      Why does this not work.. im sure the syntax isnt right, but what should it be.. im trying to refference text boxes in a form... this.tblInvoiceTableAdapter.UpdateQuery(owner_NameTextBox,owner_AddressTextBox,owner_CityTextBox,owner_StateTextBox,owner_ZipTextBox); the error is simply "Error 2 Argument '1': cannot convert from 'System.Windows.Forms.TextBox' to 'string' " I have tried the ".tostring" thing, no luck. Sorry for the stupid question, im just starting out.

      X Offline
      X Offline
      xvaughan
      wrote on last edited by
      #2

      You need to reference the .text property. I.e. this.testBox1.text = "some string" In your case it would be... this.tblInvoiceTableAdapter.UpdateQuery(owner_NameTextBox.Text,owner_AddressTextBox.Text,owner_CityTextBox.Text,owner_StateTextBox.Text,owner_ZipTextBox.Text);

      H 1 Reply Last reply
      0
      • X xvaughan

        You need to reference the .text property. I.e. this.testBox1.text = "some string" In your case it would be... this.tblInvoiceTableAdapter.UpdateQuery(owner_NameTextBox.Text,owner_AddressTextBox.Text,owner_CityTextBox.Text,owner_StateTextBox.Text,owner_ZipTextBox.Text);

        H Offline
        H Offline
        HopefulCoder
        wrote on last edited by
        #3

        Thank you!

        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