Wrox Programmer Forums
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 18th, 2005, 04:42 AM
Authorized User
 
Join Date: Jul 2004
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







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





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