473,503 Members | 10,012 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SqlDataReader Problem

I'm trying to grab some text from my database that is html formatted.
The problem is all the html formatting is lost when I try and get it
from my SqlDataReader.

sqlCmd = new SqlCommand(sqlQuery, sqlConn);
sqlRead = sqlCmd.ExecuteReader();
while (sqlRead.Read()) {
FCKeditor.Value = sqlRead.GetString(0);
}

This obviously isn't the right way to do it.. any ideas?

Dec 20 '06 #1
3 2170
try dr.GetSqlXml

--
With Regards
Shailen Sukul
..Net Architect
(MCPD: Ent Apps, MCSD.Net MCSD MCAD)
Ashlen Consulting Services
http://www.ashlen.net.au
<jo*******@gmail.comwrote in message
news:11*********************@f1g2000cwa.googlegrou ps.com...
I'm trying to grab some text from my database that is html formatted.
The problem is all the html formatting is lost when I try and get it
from my SqlDataReader.

sqlCmd = new SqlCommand(sqlQuery, sqlConn);
sqlRead = sqlCmd.ExecuteReader();
while (sqlRead.Read()) {
FCKeditor.Value = sqlRead.GetString(0);
}

This obviously isn't the right way to do it.. any ideas?

Dec 20 '06 #2
I tried this with no avail.. Any other ideas?
Shailen Sukul wrote:
try dr.GetSqlXml

--
With Regards
Shailen Sukul
.Net Architect
(MCPD: Ent Apps, MCSD.Net MCSD MCAD)
Ashlen Consulting Services
http://www.ashlen.net.au
<jo*******@gmail.comwrote in message
news:11*********************@f1g2000cwa.googlegrou ps.com...
I'm trying to grab some text from my database that is html formatted.
The problem is all the html formatting is lost when I try and get it
from my SqlDataReader.

sqlCmd = new SqlCommand(sqlQuery, sqlConn);
sqlRead = sqlCmd.ExecuteReader();
while (sqlRead.Read()) {
FCKeditor.Value = sqlRead.GetString(0);
}

This obviously isn't the right way to do it.. any ideas?
Dec 20 '06 #3
Do a Select and see if the data in the db is indeed stored as HTML first.
dr.GetSqlXml shoukd have worked if the data was XML/HTML.
--
With Regards
Shailen Sukul
..Net Architect
(MCPD: Ent Apps, MCSD.Net MCSD MCAD)
Ashlen Consulting Services
http://www.ashlen.net.au
<jo*******@gmail.comwrote in message
news:11**********************@i12g2000cwa.googlegr oups.com...
>I tried this with no avail.. Any other ideas?
Shailen Sukul wrote:
>try dr.GetSqlXml

--
With Regards
Shailen Sukul
.Net Architect
(MCPD: Ent Apps, MCSD.Net MCSD MCAD)
Ashlen Consulting Services
http://www.ashlen.net.au
<jo*******@gmail.comwrote in message
news:11*********************@f1g2000cwa.googlegro ups.com...
I'm trying to grab some text from my database that is html formatted.
The problem is all the html formatting is lost when I try and get it
from my SqlDataReader.

sqlCmd = new SqlCommand(sqlQuery, sqlConn);
sqlRead = sqlCmd.ExecuteReader();
while (sqlRead.Read()) {
FCKeditor.Value = sqlRead.GetString(0);
}

This obviously isn't the right way to do it.. any ideas?

Dec 20 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
536
by: Ricola ! | last post by:
Why do I say: SqlDataReader dr; instead of SqlDataReader dr = new SqlDataReader();
2
7359
by: Matthias S. | last post by:
Hi, I've written a simple app which should just fetch some data from a database and render the results into a ListView. In order to not freeze the GUI, I'm using a BackgroundWorker. The...
7
2343
by: Franck Diastein | last post by:
Hi, when I call ExportData I have this error: Invalid attempt to Read when reader is closed. Telling me that there's a problem with this line: while(_dataR.Read()){ Code:...
3
5864
by: Neil Guyette | last post by:
Hello, Everyone, I'm trying to find information on how to populate a combo box using a SqlDataReader. I want to be able to set the value of the combo's value property different then the...
1
3244
by: Arvind P Rangan | last post by:
Hi All, How do you get all the values of a sqldatareader if it contains multiple resultset. Using sqldatareader.nextresult and sqldatareader.read e.g. While sqldatareader.read ' If not...
8
2058
by: bidllc | last post by:
I have a funtion that works fine and dandy when called from anywhere in my app. It will NOT work when called from inside the class in which it resides. This is the function I'm calling:...
4
2356
by: mimi | last post by:
Hi Please help me out, I can't find a way to close a sqldatareader when error occur at statement cmd.ExecuteReader(). I can't close it in catch because it is local in try scope and I can't...
4
3226
by: Agnes | last post by:
I got two sub method to check some history record, Now, I found that there is some problem in Sub2() . I think the problem is about the myReader. However, I got no idea to solve it . As Sub2()...
7
1698
by: Web learner | last post by:
I am trying to create a method GetDataFor(string column) becaues I have to repeat the same statements for several columns but I get an error as follows: The name 'dr' does not exist in the current...
3
1296
by: yogarajan | last post by:
hi i am using two sqldatareader. that gives error My code start here SqlConnection conn = new SqlConnection("Data Source=**********;Initial Catalog=****; User Id=****; Password=******"); ...
0
7194
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7316
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6976
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
4993
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4666
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3160
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1495
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
729
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
372
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.