default value of a column added to a datatable

dchau12
dchau12 used Ask the Experts™
on
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
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
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

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial