473,651 Members | 2,861 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(sqlQ uery, sqlConn);
sqlRead = sqlCmd.ExecuteR eader();
while (sqlRead.Read() ) {
FCKeditor.Value = sqlRead.GetStri ng(0);
}

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

Dec 20 '06 #1
3 2182
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*******@gmai l.comwrote in message
news:11******** *************@f 1g2000cwa.googl egroups.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(sqlQ uery, sqlConn);
sqlRead = sqlCmd.ExecuteR eader();
while (sqlRead.Read() ) {
FCKeditor.Value = sqlRead.GetStri ng(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*******@gmai l.comwrote in message
news:11******** *************@f 1g2000cwa.googl egroups.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(sqlQ uery, sqlConn);
sqlRead = sqlCmd.ExecuteR eader();
while (sqlRead.Read() ) {
FCKeditor.Value = sqlRead.GetStri ng(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*******@gmai l.comwrote in message
news:11******** **************@ i12g2000cwa.goo glegroups.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*******@gma il.comwrote in message
news:11******* **************@ f1g2000cwa.goog legroups.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(sqlQ uery, sqlConn);
sqlRead = sqlCmd.ExecuteR eader();
while (sqlRead.Read() ) {
FCKeditor.Value = sqlRead.GetStri ng(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
7383
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 arguments for the RunWorkerAsync are the Query to be executed and the Connectionstring. As a result I hoped I could return a SqlDataReader. The problem is, if I create the SqlDataReader within the
7
2358
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: ************************************************* public void Export2CSV(){
3
5879
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 combo's text property (what the user will see). Is this possible with a SqlDataReader? Thanks
1
3254
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 sqldatareader then sqldatareader.nextresult
8
2070
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: "getProductByID(productID)" from inside another method in the same class. See below. This line throws a null ref exception: While dr.Read() Thanks for any insight!
4
2359
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 declare it outside try scope either since we have to call cmd.executeReader to create sqldatareader public string GetLogs(int logID) {
4
3231
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() will be used by another function. I cannot combine them , Please help. Thanks a lot. private Sub Sub1() Dim cmd As New SqlClient.SqlCommand("select invno from arinvinfo , _conn) Dim myReader As SqlDataReader myReader = cmd.ExecuteReader
7
1708
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 context It seems the dr -the instance of sqlDataReader - is not becoming available to the method. How to make it available? This seems trivial and newbie problem related to OOP, but I am confused. Could you pl. look at the code or point me to...
3
1306
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=******"); conn.Open(); //collect all employee// SqlCommand cmd = new SqlCommand("Select * from tblhrims_employeedetail where nvrresigned='no'",conn); SqlDataReader sqldr = cmd.ExecuteReader();
0
8357
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8700
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8465
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7298
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5612
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4285
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2701
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 we have to send another system
1
1910
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1588
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.