473,761 Members | 7,710 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

.net 1.1 to 2.0 - Filestream - error: Overload resolution failed because no accessible 'New' can be called without a narrowing conversion:

Since going to framework 2.0 from 1.1, I'm getting error:

Overload resolution failed because no accessible 'New' can be called
without a narrowing conversion:

On line:

Dim LogInfo As New FileStream("f:\ xxx\xxx.log",
FileShare.ReadW rite,FileAccess .Read)

This code was working fine under 1.1

I tried taking the New out, but then I get:
Array bounds cannot appear in type specifiers.

I delete the log file and try again, but the errors persist.

Jul 17 '06 #1
2 1934
Hello ja***@cyberpine .com,

I think that the old code was doing an implicit conversion. This code probably
never shoudl have worked. The second parameter should be a FileMode enumeration,
and the fourth shuold have been the FileShare:

Dim LogInfo as New FileStream("f:\ xxx\xxx.log", FileMode.Open, FileAccess.Read ,
FileShare.ReadW rite)

Not sure (maybe a VB MVP can correct me), but in 1.1 FileShare.ReadW rite's
value is 3...the same as the FileMode.Open (which is 3). Make any sense?

Thanks,
Shawn Wildermuth
Speaker, Author and C# MVP
http://adoguy.com
Since going to framework 2.0 from 1.1, I'm getting error:

Overload resolution failed because no accessible 'New' can be called
without a narrowing conversion:

On line:

Dim LogInfo As New FileStream("f:\ xxx\xxx.log",
FileShare.ReadW rite,FileAccess .Read)
This code was working fine under 1.1

I tried taking the New out, but then I get:
Array bounds cannot appear in type specifiers.
I delete the log file and try again, but the errors persist.

Jul 17 '06 #2
Yes. That fixes it. Thank you!

Shawn Wildermuth (C# MVP) wrote:
Hello ja***@cyberpine .com,

I think that the old code was doing an implicit conversion. This code probably
never shoudl have worked. The second parameter should be a FileMode enumeration,
and the fourth shuold have been the FileShare:

Dim LogInfo as New FileStream("f:\ xxx\xxx.log", FileMode.Open, FileAccess.Read ,
FileShare.ReadW rite)

Not sure (maybe a VB MVP can correct me), but in 1.1 FileShare.ReadW rite's
value is 3...the same as the FileMode.Open (which is 3). Make any sense?

Thanks,
Shawn Wildermuth
Speaker, Author and C# MVP
http://adoguy.com
Since going to framework 2.0 from 1.1, I'm getting error:

Overload resolution failed because no accessible 'New' can be called
without a narrowing conversion:

On line:

Dim LogInfo As New FileStream("f:\ xxx\xxx.log",
FileShare.ReadW rite,FileAccess .Read)
This code was working fine under 1.1

I tried taking the New out, but then I get:
Array bounds cannot appear in type specifiers.
I delete the log file and try again, but the errors persist.
Jul 17 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2606
by: Eph0nk | last post by:
Hi, I get an overload resolution failed error (Overload resolution failed because no accessible 'New' can be called without a narrowing conversion), and I can't seem to find a lot of relevant information by googling the web. Function GetFromXml(Id As String, Node As String) Dim NodeValue As String Dim xpathDoc As XPathDocument Dim xmlNav As XPathNavigator Dim xmlNI As XPathNodeIterator
5
8009
by: Gang Zhang | last post by:
Hi, I have 2 overloaded functions as below: myfunc(byval val as Decimal) as string myfunc(byval val as String) as string When calling the function with a single like: dim num1 as single = ...
1
4022
by: steve | last post by:
I am trying to create an XSLT Transform but keep getting the same problem. Overload resolution failed because no accessible 'Transform' can be called with these arguments. I create a reference to System.Xml.dll Here is the code Imports System.Xml Imports System.Xml.Xsl.XslTransform
6
3198
by: multisync | last post by:
I'm getting the following error: Overload resolution failed because no accessible 'Add' can be called with these arguments: 'Public Sub Add(item As System.Web.UI.WebControls.ListItem)': Value of type 'Admin.clsSites' cannot be converted to 'System.Web.UI.WebControls.ListItem' This is my code: Public Sub LoadSites() 'Cursor.Current = System.Windows.Forms.Cursors.WaitCursor
0
1061
by: tshad | last post by:
I am getting the following error which makes no sense. No accessible overloaded If you look at the error, there is one overloaded function that can be called (int, string, int, int). The first variable is constant that should work fine as an int and works everywhere else. The second variable is a string.
13
1555
by: Jim in Arizona | last post by:
I made a page with a gridview that has rows show a different color if a number in a column is greater than or equal to 45. I also did this conditional formatting for the column next to it. Here's my code. in the aspx file =============================== <asp:GridView ID="gvData" runat="server" OnRowDataBound="doColor"> =============================== in the aspx.vb file
1
1413
by: mharbor | last post by:
Private Sub AddNode(ByRef inXmlNode As Xml.XmlNode, _ ByRef inTreeNode As TreeNode) Dim xNode As Xml.XmlNode Dim tNode As TreeNode Dim nodeList As Xml.XmlNodeList Dim i As Long If inXmlNode.HasChildNodes() Then nodeList = inXmlNode.ChildNodes
24
2148
by: Noah Roberts | last post by:
Item #1 in the More Exceptional C++ book uses the following construct: fstream in; .... process( in.is_open() ? in : cin,...); Where process has been shown as having various multiple different
0
1022
by: ccante3070 | last post by:
What does this error message mean? program is vb.net 2003 Overload resolutionj failed because no accessible "Run" can be called with these arguments. 'Public Shared Sub Run (context As System. Windows. Forms. Application. Context)." Value of type...........
0
9345
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10115
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9957
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
9905
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
8780
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
6609
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
5373
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3881
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
3
3456
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.