|
Hi,
I'm trying to store RTF data inside of Transact-SQL and have used a data type of TEXT, however when retrieving the data from the database all I am receiving is the actual text, all of the RTF markup is gone and I am just receiving plain text.
My question is what should I be using for a data type, since TEXT is not working the way I thought it would.
Thank you,
Glenn
Glenn
|
|
|
|
|
gmhanna wrote: what should I be using for a data type
TEXT will do; it can also hold text with markup, like RTF and HTML.
What property are you writing to the field? Make sure that you're saving the Rtf[^] property to the database, and not the Text[^]. The first will contain all text, with the Rtf-markup. The second property, "richTextBox1.Text", only contains plaintext.
I are Troll
|
|
|
|
|
Hi Eddy,
I have been trying to locate how this is attached. I am using a "Data Source" and the control is bound to the data source. I have been scouring the code trying to see something like rtftextbox.text or rtftextbox.rtf, but I'm not locating it.
This control was placed on the form by dragging the RTF control from the data source and dropping it onto the form. I usually code the SQL stuff by hand but thought the automated tool was cool.
Thank you,
Glenn
|
|
|
|
|
gmhanna wrote: I have been scouring the code trying to see something like rtftextbox.text or rtftextbox.rtf, but I'm not locating it.
That's probably in InitializeComponent() , binding the property.
gmhanna wrote: I usually code the SQL stuff by hand but thought the automated tool was cool.
It can save a lot of boring typing-work, but you'll get surprises like these in return
I are Troll
|
|
|
|
|
I have this line of code in the InitializeComponent() for the binding. I could not find a definition for the word "Text", but I think what you are hinting at is I should try changing this to Rtf?
this.commentsRichTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.reunionBindingSource, "Comments", true));
Thank you,
Glenn
|
|
|
|
|
That should work, but keep in mind that it's a generated file; I don't know whether the designer will pick up the changes correctly.
I are Troll
|
|
|
|
|
Just to be picky, if your using SQL 2005 or later i would use VARCHAR(MAX)
As TEXT has been decpreciated and should be removed in the next version of SQL
Marc Clifton wrote: That has nothing to do with VB. - Oh crap. I just defended VB!
|
|
|
|
|
Thank you for the information. I am currently using SQL Sever 2008 R2, so I'll change it.
Glenn
|
|
|
|
|
hi iam using sql server 2000
i have a table with fields
itemkey nvarchar(50)
amount money
i want the querry when user enters any number like 1000 or 750
i want to display what are the itemkey and the amount equals to exactly
1000
can you give example which helps me
|
|
|
|
|
I hope that I misunderstood your question or that you have simply never written sql before:
SELECT itemkey, amount
FROM a_table_with_fields
WHERE amount = 1000
My advice is free, and you may get what you paid for.
|
|
|
|
|
Your question is not exactly clear.
However, from what I think it means, what you need is one of the most basic of SQL statements SELECT ......WHERE ......
See here[^] for syntax etc.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
hi , i want the querry for a given parameter how much items amount equals to given parameter
|
|
|
|
|
In that case the answer given by Johan should do that.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
The number of matching items can be obtained using the COUNT function:
SELECT count(*) FROM a_table_with_fields WHERE amount = 1000
|
|
|
|
|
Hello,
I have the following sql
SELECT stocksymbol,tradedate, sum(qty )
FROM TradingTransactions where stocksymbol="HINDALCO" group by stocksymbol,tradedate having sum(qty)>1000
In the above query I get the SUM of qty but how do I know which records or record Nos were selected.
Thanks
Pritha
|
|
|
|
|
Just look at the where and having clauses. It is very exact actually. If you want to see which records were used, just run the query without the where and having clauses, and without the sum function, export the whole thing to Excel, and perform the same logic there, using subtotals and auto filters.
My advice is free, and you may get what you paid for.
|
|
|
|
|
thanks for your reply
So do you mean to say that I cant know which records were included in the function through SQL in my database .And will have to go to Excel to find the same.
Pritha
|
|
|
|
|
I think that maybe I do not understand your question.
The where clause determine which records are included and the having clause determines that you don't want to see any dates which' records do not add up to (at least) 1000. That is simple and clear logic.
So if you suspect that this query is not giving you the desired result, you can use Excel as a tool to check the outcome, and visually see each single record.
My advice is free, and you may get what you paid for.
|
|
|
|
|
|
This is a very common problem with MS SQL Server (all versions I think).
Because an Express edition was installed first, you are pretty much screwed. You are going to have to uninstall the express edition, manually delete all the folders it leaves behind, reboot, and install the new version with the advanced services, etc.
For what its worth, this has happened to me twice already. Looking for other solutions will only give you a headache.
My advice is free, and you may get what you paid for.
|
|
|
|
|
I was able to not delete all the folders but did a regedit to clear that.
|
|
|
|
|
But you did have to uninstall, right?
My advice is free, and you may get what you paid for.
|
|
|
|
|
Yes uninstall was necessary and a big pain as MS does not clean-up well.
|
|
|
|
|
That was my experience as well, but at least you managed to do it with one step less than me.
My advice is free, and you may get what you paid for.
|
|
|
|
|
Well, as the title of the post can state, I'm trying to hide the taskbar and the desktop in vista and Seven. I already did it in Win XP and older OSes, but the real problem are these... In WinXP I used ShowWindow and FindWindow. If anyone could lend a hand, it would be great. Ah, almos forgot, I'm using VS2005
Thanks in advance,
Caio
|
|
|
|