473,395 Members | 1,443 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Q:Inserting a value to a dataset.

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
Oct 27 '06 #1
3 2926
Hiya Martin,

I am not quite sure of all the specifics of what you are doing but I
found the following link that sounds close:

http://forums.microsoft.com/MSDN/Sho...=9238&SiteID=1

~Gina~

Martin Arvidsson wrote:
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
Oct 27 '06 #2
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
"Martin Arvidsson" <ye*******@ms.comwrote in message
news:O1****************@TK2MSFTNGP03.phx.gbl...
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

Oct 28 '06 #3
Hi Martin,

Try the following:

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

--
Dave Sexton

"Martin Arvidsson" <ye*******@ms.comwrote in message
news:O1****************@TK2MSFTNGP03.phx.gbl...
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

Oct 29 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: bill | last post by:
How can I insert a record with a null value in one of the fields? I need to use the update method from a data adapter. The data is in a XML file.
4
by: Deepankar | last post by:
Hi, I was trying to change an example for SQL Server to work with Access db to insert image data. I have everything working except getting the OleDbParameter type for the image column. The...
2
by: a | last post by:
NEW Post Here's my best guess at how to insert this dataset.... the code runs, but no new records are added to the sql table. I've read and split a delimited text file into a dataset. It...
2
by: sweetness | last post by:
I'm new to this and desperately need help, I'm trying to insert into an sql db and i have no idea what to do and why. i created an sqladapter, and an sqlconnection by dragging and dropping. this...
6
by: Pushpendra Vats | last post by:
Hi , I am trying to insert records into database. I am trying to write the following code. On button1 click event i am inserting five records and after that i am calling the update method of...
5
by: aniket_sp | last post by:
i am using a data adapter and a dataset for filling and retrieving data into .mdb database. following is the code..... for the form load event Dim dc(0) As DataColumn Try If...
7
by: Dabbler | last post by:
I'm using an ObjectDataSource with a stored procedure and am getting the following error when trying to update (ExecuteNonQuery): System.Data.SqlClient.SqlException: Procedure or Function...
0
by: toyin | last post by:
hello, pls help look through this code its not inserting the record in dataset into the another database. i want to insert the row in the dataset into another table in another database. pls help....
0
by: SL Culby | last post by:
Hello everyone, I have a project where I pull SQL Server data put it into a dataset and now I have to put the dataset data into an Access Database. The dataset currently is over 2000 row, so looping...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.