Q:Inserting a value to a dataset.

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
 
C

chanmm

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
 
D

Dave Sexton

Hi Martin,

Try the following:

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top