Hi there...
I am a DB programming noob. I need to populate a DB from textbox fields but when I try to then commit it to the DB, I go and view the database and all I see is Nulls... nothing is being saved... please help..
thanks
private void btnSubmit_Click(object sender, EventArgs e)
{
TradesDataSet.TradesRow newTradesRow = tradesDataSet.Trades.NewTradesRow();
newTradesRow.ID = textBoxTradeID.Text;
newTradesRow.EntryPrice = textBoxEntryPrice.Text;
newTradesRow.ExitPrice = textBoxExitPrice.Text;
tradesDataSet.Trades.Rows.Add(newTradesRow);
tradesDataSet.Trades.AcceptChanges();
try
{
this.Validate();
this.tradesBindingSource.EndEdit();
this.tradesTableAdapter.Update(this.tradesDataSet.Trades);
MessageBox.Show("Update successful");
}
catch (System.Exception ex)
{
MessageBox.Show("Update failed");
}
}