PC Review


Reply
Thread Tools Rate Thread

How to change a value inside a data column???

 
 
Jon S via DotNetMonster.com
Guest
Posts: n/a
 
      2nd Nov 2005
Hi all,

If the dcSource.ColumnName == 'Text' then I would like to change the contents
of drSource[dcSource.ColumnName]. How would I do this? I know I could use
the ToString() method on the drSource[dcSource.ColumnName] to return a value
and then use the replace() method on that value. Although I would like to
change the contents using an ADO.NET way. Can this be done and how? Thanks
in advance.

if( "Text" == dcSource.ColumnName.ToString() )
{
//somehow find out if a certain string is present in the below and
if so then change the contents of the below, then copy value across.
drSource[dcSource.ColumnName] = drSource[dcSource.ColumnName]
}


--
Message posted via DotNetMonster.com
http://www.dotnetmonster.com/Uwe/For...o-net/200511/1
 
Reply With Quote
 
 
 
 
W.G. Ryan - MVP
Guest
Posts: n/a
 
      2nd Nov 2005

"Jon S via DotNetMonster.com" <u2272@uwe> wrote in message
news:56c1265750933@uwe...
> Hi all,
>
> If the dcSource.ColumnName == 'Text' then I would like to change the
> contents
> of drSource[dcSource.ColumnName]. How would I do this? I know I could
> use
> the ToString() method on the drSource[dcSource.ColumnName] to return a
> value
> and then use the replace() method on that value. Although I would like to
> change the contents using an ADO.NET way. Can this be done and how?
> Thanks
> in advance.
>
> if( "Text" == dcSource.ColumnName.ToString() )
> {
> //somehow find out if a certain string is present in the below
> and
> if so then change the contents of the below, then copy value across.
> drSource[dcSource.ColumnName] = drSource[dcSource.ColumnName]
> }
>
>
> --
> Message posted via DotNetMonster.com
>


If I understand you correctly you just change a value like this...

drSource[dcSource.ColumnName] = "NewValue";
- However in your code snippet, you're just setting a value to itself.
Maybe I dont' understand your end goal.

http://www.dotnetmonster.com/Uwe/For...o-net/200511/1


 
Reply With Quote
 
Jon S via DotNetMonster.com
Guest
Posts: n/a
 
      2nd Nov 2005
Hi Mr Ryan

Thanks for replying, it was a simple one and its resolved now. Thanks.


--
Message posted via DotNetMonster.com
http://www.dotnetmonster.com/Uwe/For...o-net/200511/1
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
change Data from column b into row based on value in column a CmSant2 Microsoft Excel Worksheet Functions 1 22nd Apr 2008 06:49 PM
Search data inside column SANTANDER Microsoft Excel Programming 3 25th Oct 2007 03:45 PM
Change the default alignment of the data item inside the field =?Utf-8?B?QmVu?= Microsoft Access 1 5th May 2005 02:51 PM
change the total while the data change in different column PINO Microsoft Excel Worksheet Functions 1 8th Oct 2004 03:08 AM
ZFD Data which I found inside my software section inside HKEY LOCAL MACHINE Terence Windows XP General 0 6th Apr 2004 03:07 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:14 AM.