Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Basics
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 18th, 2005, 04:42 AM
Authorized User
 
Join Date: Jul 2004
Location: , , .
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
Default narrowing conversion - please help

Hi I posted a question last week about saving html to a document automatically to a server, well i think i found the answer below
<code>

Dim renderedOutput = New System.Text.StringBuilder

Dim strwriter = New StringWriter(renderedOutput)

Dim tWriter = New HtmlTextWriter(strWriter)

Page.RenderControl(tWriter)

Dim OUTPUT_FILENAME = tempID & ".doc"

Dim filename = Server.MapPath("files") & "\" & OUTPUT_FILENAME

Dim outputStream = New FileStream(filename, FileMode.Create)

Dim sWriter = New StreamWriter(outputStream)

sWriter.Write(renderedOutput.ToString())

sWriter.Flush()


</code>
the problem is when i compile this code i get this error:

c:\inetpub\wwwroot\CustomerTrip\worddoc2.aspx.vb(7 88): Overload resolution failed because no accessible 'New' can be called without a narrowing conversion:
    'Public Sub New(sb As System.Text.StringBuilder)': Argument matching parameter 'sb' narrows from 'System.Object' to 'System.Text.StringBuilder'.
    'Public Sub New(formatProvider As System.IFormatProvider)': Argument matching parameter 'formatProvider' narrows from 'System.Object' to 'System.IFormatProvider'.

I have the two lines the error refers to highlighted in pink. any help would be really appreciated!
thanks,
Treasa


 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
conversion... ankur_icfai Flash (all versions) 1 November 9th, 2006 10:38 AM
Conversion anukagni Access 2 September 6th, 2006 12:22 AM
narrowing down the search webclown ASP.NET 1.0 and 1.1 Basics 13 September 27th, 2005 09:26 AM
code conversion tr8it0r Access VBA 1 April 11th, 2005 08:17 AM
conversion gbilios C++ Programming 6 August 6th, 2004 06:13 PM



All times are GMT -4. The time now is 08:09 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.