Velocity Reviews - Computer Hardware Reviews

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

Reply
Thread Tools

Replacing characters in datagrid

 
 
Tony
Guest
Posts: n/a
 
      09-25-2003
Dear all,

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

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?

Cheers
Tony

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

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


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

MasterGrid.DataSource = ds;
MasterGrid.DataBind();

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

 
Reply With Quote
 
 
 
Reply

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



Advertisments