Solved

default value of a column added to a datatable

Posted on 2006-10-23
1
686 Views
Last Modified: 2006-11-18
Is there a way to set a default value to a column added to a datatable?

Here is where I add the column:

 dsdata.Tables(0).Columns.Add("QCompID13_1", GetType(Integer))

This is in a dataset of 500 records.  I want to set this value to 997 for this column throughout the whole dataset.  Do I have to loop through the whole thing to set the value, or can I just set the value when I create the column?

ryan
0
Comment
Question by:dchau12
1 Comment
 
LVL 12

Accepted Solution

by:
Pra4444 earned 500 total points
ID: 17790542
this will help you do exactly what you want..
(just use the defaultValue property of the newly created datacolumn..

http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/VB_DOT_NET/Q_21575680.html
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now