Solved

default value of a column added to a datatable

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
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 video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

830 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