c# - Moving currency from data grid to text boxes to edit then back to data grid? -


I have a program that uses datagrids to display tables from my database, edit a description from the datagrid To do this, I click on the row and populates the data from that row into my text box. I edit it, click the save me button, and update my datagrid.

It works perfectly until I try to make a table that is using the currency. I get an uncontrolled datatype mismatch error. Now I am pretty sure that Either because I have a '£' symbol or 'because of' Since the amount is £ 4.99 but I'm stuck on the way to fix it, so I can move it in the text box and edit it correctly. Taking data in the text box works fine but when I edit and save, I get an error.

Code for transferring data from text grids to datagrid:

  // shows information in the Payment Update Area (; 0 || e.ColumnIndex & LT; E.RowIndex & lt 0) {} else {ifments! PaymentsDataGridView.Rows [e.RowIndex] .ells [e.ColumnIndex] .Value = null) {textBox_cus_id_pay. Text = "+" + Payment Data Grid view. Rao [E. Randex]. [[Payments_Customer_ID]]. value. Toasting (); TextBox_amount.Text = Payment Data Grid view. Rao [E. Randex]. [["Zodiac"]. value. Toasting (); Textbox_join_pay.Text = Payment Data Grid view Rao [E. Randex]. ["Join_Date"] Value.ToString (); }  
  DialogResult dialogResult = MessageBox.Show ("Are you sure you want to update this payment? "," Update payment "+ text box_finam.text + textbox_snonym.txt, message box.Yes;); If (dialogResult == DialogResult.Yes) {// Update Product Information (textBox_cus_id_pay.Text == "" || textBox_amount.Text == "" || textBox_join_pay.Text == "") {MessageBox.Show ("Please Do not leave any boxes empty "); } Else {string payData = textbox_us_id_pay.Text; Command.CommandText = "Update Paytable set Payments_Customer_ID = '' + textBox_cus_id_pay.Text + '', zodiac =" + textBox_amount.Text + ", Join_Date = '' + textBox_join_pay.Text + ';"; Connect.Open (); order. Connection = connect; Command.ExecuteNonQuery (); Connect.Close (); RefreshPayments (); MessageBox.Show ("Payment renewed"); }}  

Any support will receive a lot!


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -