Q:Inserting a value to a dataset.

  • Thread starter Thread starter Martin Arvidsson
  • Start date Start date
M

Martin Arvidsson

Hi!

I have a dataset, BindingSource, tablaAdapter.

I issue a BindingSource.AddNew()
After that i want to set a value in the dataset with table name projects and
fieldname projectsub to a specific value. (The value differs from time to
time)

This value is not show on the Form (Where the rest of the fields are
located) Thats why i want to do this when they press the New button on the
Toolstrip.

Right now i am mentally blocked to think this easy one out...

Regards
Martin
 
You probably using all drag and drop methods to get all your dataset and so.
Those names are geneated dynamically. You really need to understand the code
to get it working properly. It is just ADO.NET. Good luck

chanmm
 
Hi Martin,

Try the following:

DataRowView rowView = (DataRowView) bindingSource.AddNew();
rowView["projectsub"] = "specific value";
rowView.EndEdit();
 
Back
Top