Hi All,
I have the following code....
It is basically, taking the values from my various text boxes on the form and trying to insert a new record in the database using those values...
This is creating no exceptions or any errors, however when I close the app and check the database, the table in the database doesnt contain any of the information i had hoped to write to it....
Can anyone spot any problems with the code?
I am very new to .NET!
I have the following code....
Code:
private void button2_Click(object sender, EventArgs e)
{
decimal myAmount = System.Convert.ToDecimal(this.amountTextBox.Text);
decimal myVat = System.Convert.ToDecimal(this.vatTextBox.Text);
int mySupplier = System.Convert.ToInt32(this.supplierComboBox.SelectedValue);
string myDescription = this.descriptionTextBox.Text;
DateTime myDateAdded = DateTime.Parse(this.dateaddedDateTimePicker.Text);
int myEventID = iPromote.eventID;
int mySupplierID = System.Convert.ToInt32(this.supplierComboBox.SelectedValue);
try
{
this.receiptsTableAdapter1.Insert(myAmount, myDescription, myVat, myDateAdded, myEventID, mySupplierID);
}
catch(Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
It is basically, taking the values from my various text boxes on the form and trying to insert a new record in the database using those values...
This is creating no exceptions or any errors, however when I close the app and check the database, the table in the database doesnt contain any of the information i had hoped to write to it....
Can anyone spot any problems with the code?
I am very new to .NET!