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

  • Thread starter Thread starter Jon S via DotNetMonster.com
  • Start date Start date
J

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]
}
 
Jon S via DotNetMonster.com said:
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]
}

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
 
Hi Mr Ryan

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