Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Replacing characters in datagrid

Thread Tools

Replacing characters in datagrid

Posts: n/a
Dear all,

I'm using a datagrid in a c# page to display data
from a dataset populated from my SQL Server. So far, so

The grid contains a "Problem Description" field which
contains carriage returns etc which are not displayed on
the page when the datagrid is rendered.

I've had an attempt to modify the string using the replace
method but so far no luck (see below). Any ideas on where
I'm going wrong?


// ----------------

// create the dataset and fill it
DataSet ds = new DataSet();

for(int i=0;i < ds.Tables[0].Rows.Count-1 ; i++)
strReplaced = ds.Tables[0].Rows[i]["Problem
strReplaced = strReplaced.Replace("\n","<br>");

MasterGrid.DataSource = ds;

// ----------------

Reply With Quote

Thread Tools

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
replacing \n characters in a hash Johhny Python 10 01-26-2006 03:58 PM
Replacing utf-8 characters Mike Python 8 10-05-2005 10:17 PM
Replacing - and not Replacing... Rob Meade ASP General 5 04-11-2005 06:49 PM
RE: Replacing "illegal characters" in html Robert Brewer Python 0 05-09-2004 08:12 PM
Replacing "illegal characters" in html BenO Python 0 05-09-2004 07:48 PM