473,387 Members | 1,791 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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 2169
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
by: Ricola ! | last post by:
Why do I say: SqlDataReader dr; instead of SqlDataReader dr = new SqlDataReader();
2
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
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
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
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
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
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
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
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
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
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...

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.