Totally Beginner Question.. Updating SQL Server DB.
-
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.
-
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.
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);
-
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);
Thank you!