Solved

default value of a column added to a datatable

Posted on 2006-10-23
1
688 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Where to begin studying? 5 80
ISS migration from IIS 6 to IIS 8.5 rendering problems 4 50
Authentication of Web Services 3 46
Message not shown 5 27
Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
A company’s greatest vulnerability is their email. CEO fraud, ransomware and spear phishing attacks are the no1 threat to a company’s security. Cybercrime is responsible for the largest loss of money to companies today with losses projected to r…

932 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

12 Experts available now in Live!

Get 1:1 Help Now