Update field value Using Tableadapt C#

Asked

Viewed 32 times

1

Nostalgia!

I am working with Dataset to modify data in BD sql. I have a Tableadapter allocated to a form where some of the fields are linked to textboxes. It turns out that some of the fields I don’t want to show in textbox but I want to update their values via code. How do this??

Here’s the code to save the data:

private void clBindingNavigatorSaveItem_Click(object sender, EventArgs e)
{

    this.Validate();

    micro.cl.Rows[0]["clstamp"] = "vc233546xxz";

    this.clBindingSource.EndEdit();
    clTableAdapter.Update(micro.cl);

}

//"micro" é o nome da minha Dataset
//A minha table "cl" contém 3 campos: codigo,nome e clstamp.
//o codigo e o nome sao introduzidos pelo utilizador, enquando que o clstamp 
//será uma chave aleatoria que será gerada ao gravar, e ela n precisa ser 
//mostrada ao utilizador.
  • Hello @Virgiliocossa, welcome to Stackoverflow. Take a look at the Tour to better understand how to correctly pose a question. As for yours, can pf put the code you are using? It helps us to better understand the problem, but it seems to me that the solution will be to remove the link controls that it does not intend to update automatically.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.