Showing posts with label class. Show all posts
Showing posts with label class. Show all posts

Wednesday, March 28, 2012

Such an easy question

VS 2005 issue

Hi I have a batch file I would like to run - once I kick off a build event for a class library

If you look in project -> properties -> Compile -> Build Events

you can enter commands in 2 windows - pre build and post build

I entered

call S:\Securinfo.NET\Atlantis Release\slnAuthManager.root\slnAuthManager\Business Logic\bllAuthManager\inc.bat

And now all I get is exited with code 1

Any ideas people - please !!!

If you go to the bin (or bin\debug) directory after building the solution, you will see the bat file that Visual Studio creates from your build event.

Open a command line, navigate to that folder, and then type the bat file name at the prompt and it will execute. Any errors should display on the screen.

Monday, March 26, 2012

Suggestion for ArrayOfLinkedLists and LinkedList

Hello,

I miss the LinkedList class in System.Collections.Specialized very often. It would be of great use in the framework. An additional ArrayOfLinkedLists class would be great too (e.g. for implementation of a graph).

Regards,

David van LeerdamYou can find a LinkedList in the System.Collection.Generic namespace

System.Collections.Generic.LinkedList<T>
System.Collections.Generic.LinkedListNode<T

Saturday, March 24, 2012

Summary text doesn't work

I've created a summary text for a method of a class, but it doesn't
appear whem i add it to another project, i can see it only in the same
project.
Thanks
PietroTake a look at this:
http://dotnet.mvps.org/dotnet/faqs/...ntation&lang=en
XML comments (like all comments) aren't part of a .dll (otherwise the .dll
would bloat in size). As such, as for as your other application is
concerned, there is no summary text. One would think that you could use
the DescriptionAttribute, but this unfortunetly doens't work for
intellisense (just th properties window). The above link shows how to hook
the outputted xml file from the original source to the dll you are
referecing in yoru other project...thus preserving the summary information.
karl
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"Pietro" <piefox@.uol.com.br> wrote in message
news:eCkWOOPQFHA.3296@.TK2MSFTNGP15.phx.gbl...
> I've created a summary text for a method of a class, but it doesn't
> appear whem i add it to another project, i can see it only in the same
> project.
> Thanks
> Pietro

Summary text doesnt work

I've created a summary text for a method of a class, but it doesn't
appear whem i add it to another project, i can see it only in the same
project.

Thanks
PietroTake a look at this:
http://dotnet.mvps.org/dotnet/faqs/...ntation&lang=en

XML comments (like all comments) aren't part of a .dll (otherwise the .dll
would bloat in size). As such, as for as your other application is
concerned, there is no summary text. One would think that you could use
the DescriptionAttribute, but this unfortunetly doens't work for
intellisense (just th properties window). The above link shows how to hook
the outputted xml file from the original source to the dll you are
referecing in yoru other project...thus preserving the summary information.

karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"Pietro" <piefox@.uol.com.br> wrote in message
news:eCkWOOPQFHA.3296@.TK2MSFTNGP15.phx.gbl...
> I've created a summary text for a method of a class, but it doesn't
> appear whem i add it to another project, i can see it only in the same
> project.
> Thanks
> Pietro

Thursday, March 22, 2012

Suppress Form Action

A custom server control has a Button.

Namespace Confirm
Public Class ShowConfirm : Inherits Button
Private strConfirmMsg As String
Public Property ConfirmMessage() As String
Get
ConfirmMessage = strConfirmMsg
End Get
Set(ByVal value As String)
strConfirmMsg = value
End Set
End Property

Protected Overrides Sub AddAttributesToRender(ByVal Output As
HtmlTextWriter)
MyBase.AddAttributesToRender(Output)
Output.AddAttribute(HtmlTextWriterAttribute.OnClic k,
"ConfirmMsg()")
End Sub

Protected Overrides Sub RenderContents(ByVal Output As
HtmlTextWriter)
Output.Write(vbCrLf)
Output.Write("<script language='JavaScript'>")
Output.Write(vbCrLf)
Output.Write("function ConfirmMsg(){")
Output.Write(vbCrLf)
Output.Write("var answer = confirm('")
Output.Write(strConfirmMsg)
Output.Write("')")
Output.Write(vbCrLf)

Output.Write("location.href = window.location.href +
'?Proceed=' + answer")
Output.Write(vbCrLf)
Output.Write("}")
Output.Write(vbCrLf)
Output.Write("</script>")
End Sub
End Class
End Namespace

Using VBC, I compiled the above into 'Confirm.dll'. This is how I am
using the above custom control in an ASPX page (assume that the ASPX
page is named Confirm.aspx):

<%@dotnet.itags.org. Register Assembly="Confirm" Namespace="Confirm" TagPrefix="CC" %>

<form EnableViewState="true" runat="server">
<CC:ShowConfirm ID="ShowConfirm1" ConfirmMessage="WANNA EXIT?"
Text="EXIT" runat="server"/>
</form>

Note the

Output.Write("location.href = window.location.href + '?Proceed=' +
answer")

line in the VB class file code. When the ASPX page gets rendered, it
displays a Button. Conventionally, when a Button is clicked in an ASPX
page, it posts back to itself using the POST method. When the Button in
the above custom control is clicked, a JavaScript confirm dialog
pops-up with 2 buttons - 'OK' & 'Cancel'. If 'OK' is clicked, the value
of the JavaScript variable 'answer' is true & if 'Cancel' is clicked,
the value of the variable 'answer' is false.

What I want is irrespective of whether a user clicks the 'OK' or
'Cancel' button in the confirm dialog, instead of posting back to
itself using the conventional POST method, I want the ASPX page to post
to itself BUT with a querystring 'Proceed=<value>' appended i.e. I want
to suppress the conventional post & instead add the querystring so that
I can find out whether the user has clicked the 'OK' button or the
'Cancel' button in the confirm dialog. If the user clicks 'OK', he will
be taken to

http://myserver/aspx/Confirm.aspx?Proceed=true
If the user clicks 'Cancel' in the confirm dialog, he will be taken to

http://myserver/aspx/Confirm.aspx?Proceed=false
Can this be done in anyway?Anyone?

rn5a@.rediffmail.com wrote:

Quote:

Originally Posted by

A custom server control has a Button.
>
Namespace Confirm
Public Class ShowConfirm : Inherits Button
Private strConfirmMsg As String
Public Property ConfirmMessage() As String
Get
ConfirmMessage = strConfirmMsg
End Get
Set(ByVal value As String)
strConfirmMsg = value
End Set
End Property
>
Protected Overrides Sub AddAttributesToRender(ByVal Output As
HtmlTextWriter)
MyBase.AddAttributesToRender(Output)
Output.AddAttribute(HtmlTextWriterAttribute.OnClic k,
"ConfirmMsg()")
End Sub
>
Protected Overrides Sub RenderContents(ByVal Output As
HtmlTextWriter)
Output.Write(vbCrLf)
Output.Write("<script language='JavaScript'>")
Output.Write(vbCrLf)
Output.Write("function ConfirmMsg(){")
Output.Write(vbCrLf)
Output.Write("var answer = confirm('")
Output.Write(strConfirmMsg)
Output.Write("')")
Output.Write(vbCrLf)
>
Output.Write("location.href = window.location.href +
'?Proceed=' + answer")
Output.Write(vbCrLf)
Output.Write("}")
Output.Write(vbCrLf)
Output.Write("</script>")
End Sub
End Class
End Namespace
>
Using VBC, I compiled the above into 'Confirm.dll'. This is how I am
using the above custom control in an ASPX page (assume that the ASPX
page is named Confirm.aspx):
>
<%@. Register Assembly="Confirm" Namespace="Confirm" TagPrefix="CC" %>
>
<form EnableViewState="true" runat="server">
<CC:ShowConfirm ID="ShowConfirm1" ConfirmMessage="WANNA EXIT?"
Text="EXIT" runat="server"/>
</form>
>
Note the
>
Output.Write("location.href = window.location.href + '?Proceed=' +
answer")
>
line in the VB class file code. When the ASPX page gets rendered, it
displays a Button. Conventionally, when a Button is clicked in an ASPX
page, it posts back to itself using the POST method. When the Button in
the above custom control is clicked, a JavaScript confirm dialog
pops-up with 2 buttons - 'OK' & 'Cancel'. If 'OK' is clicked, the value
of the JavaScript variable 'answer' is true & if 'Cancel' is clicked,
the value of the variable 'answer' is false.
>
What I want is irrespective of whether a user clicks the 'OK' or
'Cancel' button in the confirm dialog, instead of posting back to
itself using the conventional POST method, I want the ASPX page to post
to itself BUT with a querystring 'Proceed=<value>' appended i.e. I want
to suppress the conventional post & instead add the querystring so that
I can find out whether the user has clicked the 'OK' button or the
'Cancel' button in the confirm dialog. If the user clicks 'OK', he will
be taken to
>
http://myserver/aspx/Confirm.aspx?Proceed=true
>
If the user clicks 'Cancel' in the confirm dialog, he will be taken to
>
http://myserver/aspx/Confirm.aspx?Proceed=false
>
Can this be done in anyway?

Suppress Form Action

A custom server control has a Button.

Namespace Confirm
Public Class ShowConfirm : Inherits Button
Private strConfirmMsg As String
Public Property ConfirmMessage() As String
Get
ConfirmMessage = strConfirmMsg
End Get
Set(ByVal value As String)
strConfirmMsg = value
End Set
End Property

Protected Overrides Sub AddAttributesToRender(ByVal Output As HtmlTextWriter)
MyBase.AddAttributesToRender(Output)
Output.AddAttribute(HtmlTextWriterAttribute.OnClick, "ConfirmMsg()")
End Sub

Protected Overrides Sub RenderContents(ByVal Output As HtmlTextWriter)
Output.Write(vbCrLf)
Output.Write("<script language='JavaScript'>")
Output.Write(vbCrLf)
Output.Write("function ConfirmMsg(){")
Output.Write(vbCrLf)
Output.Write("var answer = confirm('")
Output.Write(strConfirmMsg)
Output.Write("')")
Output.Write(vbCrLf)

Output.Write("location.href = window.location.href + '?Proceed=' + answer")
Output.Write(vbCrLf)
Output.Write("}")
Output.Write(vbCrLf)
Output.Write("</script>")
End Sub
End Class
End Namespace

Using VBC, I compiled the above intoConfirm.dll. This is how I am using the above custom control in an ASPX page (assume that the ASPX page is namedConfirm.aspx):

<%@dotnet.itags.org. Register Assembly="Confirm" Namespace="Confirm" TagPrefix="CC" %
<form EnableViewState="true" runat="server">
<CC:ShowConfirm ID="ShowConfirm1" ConfirmMessage="WANNA EXIT?" Text="EXIT" runat="server"/>
</form>

Note the

Output.Write("location.href = window.location.href + '?Proceed=' + answer")

line (which is highlighted) in the VB class file code. When the ASPX page gets rendered, it displays a Button. Conventionally, when a Button is clicked in an ASPX page, it posts back to itself using the POST method. When the Button in the above custom control is clicked, a JavaScriptconfirm dialog pops-up with 2 buttons -OK &Cancel. IfOK is clicked, the value of the JavaScript variableanswer istrue & ifCancel is clicked, the value of the variableanswer isfalse.

What I want is irrespective of whether a user clicks theOK orCancel button in theconfirm dialog, instead of posting back to itself using the conventional POST method, I want the ASPX page to post to itself BUT with a querystringProceed=<value> appended i.e. I want to suppress the conventional post & instead add the querystring so that I can find out whether the user has clicked theOK button or theCancel button in theconfirm dialog. If the user clicksOK, he will be taken to

http://myserver/aspx/Confirm.aspx?Proceed=true

On the other hand, if the user clicksCancel in theconfirm dialog, he will be taken to

http://myserver/aspx/Confirm.aspx?Proceed=false

Can this be done in anyway?

Output.AddAttribute(HtmlTextWriterAttribute.OnClick, "ConfirmMsg();return false;")


Thanks, mate, your suggestion turned out to be a great one. Could you please tell me what role doesreturn=false; which you have appended afterConfirmMsg(), play here?

Going by your suggestion does add the querystringProceed=<value> at the end of the URL but there's a *** here. Suppose when a user clicks the server-side Button; he is shown the JavaScriptconfirm dialog with theOK &Cancel buttons. If the user clicksOK, then he is taken to

http://myserver/aspx/Confirm.aspx?Proceed=true

That's fine but if the user clicks the server-side Button once again & clicksCancel in theconfirm dialog, then he is taken to

http://myserver/aspx/Confirm.aspx?Proceed=true?Proceed=false

i.e. the querystring gets appended twice. In other words, a querystringProceed=<value> will go on getting appended at the URL wheneverOK &Cancel is clicked in the JavaScriptconfirm dialog. For e.g. if a user clicks eitherOK orCancel in theconfirm dialog 5 times, then the querystring will get appended one after the other 5 times.

Any workaround to overcome this?

Suppress Form Action

A custom server control has a Button.
Namespace Confirm
Public Class ShowConfirm : Inherits Button
Private strConfirmMsg As String
Public Property ConfirmMessage() As String
Get
ConfirmMessage = strConfirmMsg
End Get
Set(ByVal value As String)
strConfirmMsg = value
End Set
End Property
Protected Overrides Sub AddAttributesToRender(ByVal Output As
HtmlTextWriter)
MyBase.AddAttributesToRender(Output)
Output.AddAttribute(HtmlTextWriterAttribute.OnClick,
"ConfirmMsg()")
End Sub
Protected Overrides Sub RenderContents(ByVal Output As
HtmlTextWriter)
Output.Write(vbCrLf)
Output.Write("<script language='JavaScript'>")
Output.Write(vbCrLf)
Output.Write("function ConfirmMsg(){")
Output.Write(vbCrLf)
Output.Write("var answer = confirm('")
Output.Write(strConfirmMsg)
Output.Write("')")
Output.Write(vbCrLf)
Output.Write("location.href = window.location.href +
'?Proceed=' + answer")
Output.Write(vbCrLf)
Output.Write("}")
Output.Write(vbCrLf)
Output.Write("</script>")
End Sub
End Class
End Namespace
Using VBC, I compiled the above into 'Confirm.dll'. This is how I am
using the above custom control in an ASPX page (assume that the ASPX
page is named Confirm.aspx):
<%@dotnet.itags.org. Register Assembly="Confirm" Namespace="Confirm" TagPrefix="CC" %>
<form EnableViewState="true" runat="server">
<CC:ShowConfirm ID="ShowConfirm1" ConfirmMessage="WANNA EXIT?"
Text="EXIT" runat="server"/>
</form>
Note the
Output.Write("location.href = window.location.href + '?Proceed=' +
answer")
line in the VB class file code. When the ASPX page gets rendered, it
displays a Button. Conventionally, when a Button is clicked in an ASPX
page, it posts back to itself using the POST method. When the Button in
the above custom control is clicked, a JavaScript confirm dialog
pops-up with 2 buttons - 'OK' & 'Cancel'. If 'OK' is clicked, the value
of the JavaScript variable 'answer' is true & if 'Cancel' is clicked,
the value of the variable 'answer' is false.
What I want is irrespective of whether a user clicks the 'OK' or
'Cancel' button in the confirm dialog, instead of posting back to
itself using the conventional POST method, I want the ASPX page to post
to itself BUT with a querystring 'Proceed=<value>' appended i.e. I want
to suppress the conventional post & instead add the querystring so that
I can find out whether the user has clicked the 'OK' button or the
'Cancel' button in the confirm dialog. If the user clicks 'OK', he will
be taken to
http://myserver/aspx/Confirm.aspx?Proceed=true
If the user clicks 'Cancel' in the confirm dialog, he will be taken to
http://myserver/aspx/Confirm.aspx?Proceed=false
Can this be done in anyway?Anyone?
rn5a@.rediffmail.com wrote:
> A custom server control has a Button.
> Namespace Confirm
> Public Class ShowConfirm : Inherits Button
> Private strConfirmMsg As String
> Public Property ConfirmMessage() As String
> Get
> ConfirmMessage = strConfirmMsg
> End Get
> Set(ByVal value As String)
> strConfirmMsg = value
> End Set
> End Property
> Protected Overrides Sub AddAttributesToRender(ByVal Output As
> HtmlTextWriter)
> MyBase.AddAttributesToRender(Output)
> Output.AddAttribute(HtmlTextWriterAttribute.OnClick,
> "ConfirmMsg()")
> End Sub
> Protected Overrides Sub RenderContents(ByVal Output As
> HtmlTextWriter)
> Output.Write(vbCrLf)
> Output.Write("<script language='JavaScript'>")
> Output.Write(vbCrLf)
> Output.Write("function ConfirmMsg(){")
> Output.Write(vbCrLf)
> Output.Write("var answer = confirm('")
> Output.Write(strConfirmMsg)
> Output.Write("')")
> Output.Write(vbCrLf)
> Output.Write("location.href = window.location.href +
> '?Proceed=' + answer")
> Output.Write(vbCrLf)
> Output.Write("}")
> Output.Write(vbCrLf)
> Output.Write("</script>")
> End Sub
> End Class
> End Namespace
> Using VBC, I compiled the above into 'Confirm.dll'. This is how I am
> using the above custom control in an ASPX page (assume that the ASPX
> page is named Confirm.aspx):
> <%@. Register Assembly="Confirm" Namespace="Confirm" TagPrefix="CC" %>
> <form EnableViewState="true" runat="server">
> <CC:ShowConfirm ID="ShowConfirm1" ConfirmMessage="WANNA EXIT?"
> Text="EXIT" runat="server"/>
> </form>
> Note the
> Output.Write("location.href = window.location.href + '?Proceed=' +
> answer")
> line in the VB class file code. When the ASPX page gets rendered, it
> displays a Button. Conventionally, when a Button is clicked in an ASPX
> page, it posts back to itself using the POST method. When the Button in
> the above custom control is clicked, a JavaScript confirm dialog
> pops-up with 2 buttons - 'OK' & 'Cancel'. If 'OK' is clicked, the value
> of the JavaScript variable 'answer' is true & if 'Cancel' is clicked,
> the value of the variable 'answer' is false.
> What I want is irrespective of whether a user clicks the 'OK' or
> 'Cancel' button in the confirm dialog, instead of posting back to
> itself using the conventional POST method, I want the ASPX page to post
> to itself BUT with a querystring 'Proceed=<value>' appended i.e. I want
> to suppress the conventional post & instead add the querystring so that
> I can find out whether the user has clicked the 'OK' button or the
> 'Cancel' button in the confirm dialog. If the user clicks 'OK', he will
> be taken to
> http://myserver/aspx/Confirm.aspx?Proceed=true
> If the user clicks 'Cancel' in the confirm dialog, he will be taken to
> http://myserver/aspx/Confirm.aspx?Proceed=false
> Can this be done in anyway?

Supress error/warning of winapi in class?

I have this error:
Warning 1 Access of shared member, constant member, enum member or nested
type through an instance; qualifying expression will not be evaluated...
This because i have a call in a win32 dll:
Public Declare Ansi Function TheCall Lib "MyDll.DLL" Alias "TheCall" (ByVal
szKey As String) As Int32
Option Explict or Strict don't do anything here.
I'm looking for a solution hopefully placed in the class itself if possible.
The call is executed through the dimensioned class var.
'you are referencing a static method from an instance rather than its class.
use ClassName.MethodName (class referenece), not myObj.MethodName (instance
reference)
-- bruce (sqlwork.com)
"Edwin Knoppert" <news@.hellobasic.com> wrote in message
news:439eef25$0$2339$ba620dc5@.text.nova.planet.nl...
>I have this error:
> Warning 1 Access of shared member, constant member, enum member or nested
> type through an instance; qualifying expression will not be evaluated...
> This because i have a call in a win32 dll:
> Public Declare Ansi Function TheCall Lib "MyDll.DLL" Alias "TheCall"
> (ByVal szKey As String) As Int32
> Option Explict or Strict don't do anything here.
> I'm looking for a solution hopefully placed in the class itself if
> possible.
> The call is executed through the dimensioned class var.
> '
>
Hey, thanks, thought the declares where not public, brain-dead of course.
It says: PUBLIC :)
To bad i couldn't reuse my WITH statement with these calls.
I swapped it for the dimmed object but MS does not like that :)
Thanks,
"Bruce Barker" <brubar_nospamplease_@.safeco.com> schreef in bericht
news:eMrI3rAAGHA.1268@.TK2MSFTNGP11.phx.gbl...
> you are referencing a static method from an instance rather than its
> class. use ClassName.MethodName (class referenece), not myObj.MethodName
> (instance reference)
> -- bruce (sqlwork.com)
>
> "Edwin Knoppert" <news@.hellobasic.com> wrote in message
> news:439eef25$0$2339$ba620dc5@.text.nova.planet.nl...
>

Tuesday, March 13, 2012

Suspect error using RichTextBox Class in server code

Using the 1.1 framework. We are using a newly created instance of a
RichTextBox Class in our server code to manipulate RTF that is stored
in the database. To clarify, we are not using or attempting to use
this class in the aspx page that calls the code, nor is the 'using
System.Windows.Forms' referenced in any of the aspx pages. The first
client using this software has been experiencing an error that we
cannot reproduce in-house. The error occurs intermittently anywhere
after 2-4 days of use, so it is not something reproducible on demand.
The fix is to restart IIS and on a couple of occasions a restart of
the server was necessary. The error is being trapped in code and
returned as string to the user which displays on the aspx page so it
is not an unhandled exception with a dump of the stack trace. The
error message is 'Error creating window handle". Once one user
receives this error all users receive the same error when trying to
perform the same operation. I am not 100% sure that the RichTextBox
code is what is causing the error but based on the message involved it
is my best guess. Here is a code snipit that shows how we are using
the RichTextBox.

string strFreeRTF = drRow["FRTF"].ToString().Trim();
string strTempRTF = drRow["TMPLTRTF"].ToString().Trim();
RichTextBox rtfFree = new RichTextBox();
rtfFree.Rtf = strFreeRTF; //prevents null reference
RichTextBox rtfTemp = new RichTextBox();
rtfTemp.Rtf = strTempRTF;
if(rtfTemp.Text.Length > 0)
{
rtfFree.AppendText("\r\n");
rtfTemp.SelectAll();
rtfTemp.Copy();
rtfFree.Paste();
}
if(strCodedCharting.Length > 0)
{
rtfFree.AppendText("\r\n");
rtfFree.AppendText(strCodedCharting);
}

if(drChart["SUMMARY"].ToString() != "")
{
if(rtfFree.Text.Length > 0)
{
rtfFree.AppendText("\r\n");
}
rtfFree.AppendText(drRow["SMRYTXT"].ToString());
}
if(rtfFree.Text != "")
strRet = rtfFree.Rtf;
return strRet;

The code performs what it is designed to do but obviously we need to
track down why the error occurs.

Does anyone have information that might assist with troubleshooting
this problem. Thanksusing winform controls are not supported by aspx pages. they require a
window handle to perform correctly, and system services like iis and
asp.net, do not have permission to create a window handle as they need
access to the desktop.

you might get away with it if the console is alway logged on the server, and
you gave permission. you still run the risk, that if the control pop's up a
dialog box (say for en error), your asp.net thread will be blocked until
some goes to the console and responds to the dialogbox.

this is very poor design, and you should look at replacing the rtf control
as soon as possible.

-- bruce (sqlwork.com)

"Eric" <msdnsupport@.nospammediserve.com> wrote in message
news:3fc3df27.1150041703@.news.devexpress.com...
> Using the 1.1 framework. We are using a newly created instance of a
> RichTextBox Class in our server code to manipulate RTF that is stored
> in the database. To clarify, we are not using or attempting to use
> this class in the aspx page that calls the code, nor is the 'using
> System.Windows.Forms' referenced in any of the aspx pages. The first
> client using this software has been experiencing an error that we
> cannot reproduce in-house. The error occurs intermittently anywhere
> after 2-4 days of use, so it is not something reproducible on demand.
> The fix is to restart IIS and on a couple of occasions a restart of
> the server was necessary. The error is being trapped in code and
> returned as string to the user which displays on the aspx page so it
> is not an unhandled exception with a dump of the stack trace. The
> error message is 'Error creating window handle". Once one user
> receives this error all users receive the same error when trying to
> perform the same operation. I am not 100% sure that the RichTextBox
> code is what is causing the error but based on the message involved it
> is my best guess. Here is a code snipit that shows how we are using
> the RichTextBox.
>
> string strFreeRTF = drRow["FRTF"].ToString().Trim();
> string strTempRTF = drRow["TMPLTRTF"].ToString().Trim();
> RichTextBox rtfFree = new RichTextBox();
> rtfFree.Rtf = strFreeRTF; //prevents null reference
> RichTextBox rtfTemp = new RichTextBox();
> rtfTemp.Rtf = strTempRTF;
> if(rtfTemp.Text.Length > 0)
> {
> rtfFree.AppendText("\r\n");
> rtfTemp.SelectAll();
> rtfTemp.Copy();
> rtfFree.Paste();
> }
> if(strCodedCharting.Length > 0)
> {
> rtfFree.AppendText("\r\n");
> rtfFree.AppendText(strCodedCharting);
> }
> if(drChart["SUMMARY"].ToString() != "")
> {
> if(rtfFree.Text.Length > 0)
> {
> rtfFree.AppendText("\r\n");
> }
> rtfFree.AppendText(drRow["SMRYTXT"].ToString());
> }
> if(rtfFree.Text != "")
> strRet = rtfFree.Rtf;
> return strRet;
> The code performs what it is designed to do but obviously we need to
> track down why the error occurs.
> Does anyone have information that might assist with troubleshooting
> this problem. Thanks