R
Rodrigo
Dears,
I have had problems to save the changes made on a form to the database. When
I call the code bellow the changes are made only at the dataset, but when I
refresh the form the data keeps unchanged.
I need this help to continue with my project. If can help I can send the
full source.
private void tbar_ButtonClick(object sender,
System.Windows.Forms.ToolBarButtonClickEventArgs e)
{
try
{
switch(tbar.Buttons.IndexOf(e.Button))
{
case 0:
try
{
int record = BindingContext[dsCliente.Tables["tbCLIENTE"]].Position;
daCliente.Update(dsCliente, "tbCLIENTE");
dsCliente.Tables["tbCLIENTE"].Rows[record].EndEdit();
dsCliente.AcceptChanges();
break;
}
catch
{
}
case 1:
//MessageBox.Show("Copiar");
break;
case 2:
//MessageBox.Show("Apagar");
break;
}
}
catch
{
MessageBox.Show("Erro ao Salvar");
}
}
}
I have had problems to save the changes made on a form to the database. When
I call the code bellow the changes are made only at the dataset, but when I
refresh the form the data keeps unchanged.
I need this help to continue with my project. If can help I can send the
full source.
private void tbar_ButtonClick(object sender,
System.Windows.Forms.ToolBarButtonClickEventArgs e)
{
try
{
switch(tbar.Buttons.IndexOf(e.Button))
{
case 0:
try
{
int record = BindingContext[dsCliente.Tables["tbCLIENTE"]].Position;
daCliente.Update(dsCliente, "tbCLIENTE");
dsCliente.Tables["tbCLIENTE"].Rows[record].EndEdit();
dsCliente.AcceptChanges();
break;
}
catch
{
}
case 1:
//MessageBox.Show("Copiar");
break;
case 2:
//MessageBox.Show("Apagar");
break;
}
}
catch
{
MessageBox.Show("Erro ao Salvar");
}
}
}