Home All Groups Group Topic Archive Search About

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

Author
2 Nov 2005 10:28 AM
Jon S via DotNetMonster.com
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]
}



Author
2 Nov 2005 1:40 PM
W.G. Ryan - MVP
"Jon S via DotNetMonster.com" <u2272@uwe> wrote in message
news:56c1265750933@uwe...
Show quote
> 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/Forums.aspx/dotnet-ado-net/200511/1
Author
2 Nov 2005 2:43 PM
Jon S via DotNetMonster.com
Hi Mr Ryan

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



AddThis Social Bookmark Button