Wrox Programmer Forums
|
VB Databases Basics Beginning-level VB coding questions specific to using VB with databases. Issues not specific to database use will be redirected to other forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB Databases Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 22nd, 2005, 09:30 AM
Registered User
 
Join Date: May 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Insert one value into a dataset

hello;

I have a dataset with many records, i would lilke to insert one specific number to all records in one specific field, how would a do that without having to traverse through all records..

Thanks

Fernb2000

 
Old May 25th, 2005, 10:30 AM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

I would use SQL to change the data in the database first, and then fill the dataset.

Alternatively, when you fill the dataset, set up your SQL to concatenate that specific number to the database's information as it is being retrieved. To append a 1 to all FNames from an Oracle DB you might use something like:
Code:
SELECT FNAME||'1' NEWNAME, LNAME
FROM EMPLOYEES
ORDER BY LNAME
(“||” is the concatenation operator for Oracle.)





Similar Threads
Thread Thread Starter Forum Replies Last Post
insert nulls using a typed dataset humour ASP.NET 2.0 Professional 3 April 16th, 2008 05:17 AM
Fill(dataset) or dataset.load() salemkoten SQL Server 2005 1 November 2nd, 2006 11:04 PM
Converting a untyped dataset to a typed dataset daphnean Visual Studio 2005 0 July 13th, 2006 01:16 AM
trigger to insert current date on insert kev_79 SQL Server 2000 3 January 23rd, 2006 05:58 PM
Re: SQL Server dataset to ACCESS dataset dazzer ADO.NET 0 March 22nd, 2004 05:28 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.