Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / February 2008

Tip: Looking for answers? Try searching our database.

compiler error

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
CJ - 26 Feb 2008 01:06 GMT
Can someone tell me what this error means and how to get rid of it.

           ADODB.Stream adodbstream = new ADODB.Stream();
           adodbstream.Type = ADODB.StreamTypeEnum.adTypeText;
           adodbstream.Charset = "US-ASCII";
           adodbstream.Open();
Error 1 No overload for method 'Open' takes '0' arguments
C:\Projects\Form1.cs 36 13 FormNew

Thanks
Peter Duniho - 26 Feb 2008 01:18 GMT
> Can someone tell me what this error means and how to get rid of it.
>
[quoted text clipped - 4 lines]
> Error 1 No overload for method 'Open' takes '0' arguments
> C:\Projects\Form1.cs 36 13 FormNew

It means that no overload for the method named "Open" takes no arguments.  
If the class hasn't declared an overload for the method with no arguments,  
then you cannot call it without arguments.

To fix it, figure out what version of the method you _do_ want to use, and  
pass the appropriate arguments.

Pete
Michael A. Covington - 26 Feb 2008 01:21 GMT
>            adodbstream.Open();
> Error 1 No overload for method 'Open' takes '0' arguments

It means you cannot call Open(...) without anything in place of the '...'.
Arne Vajhøj - 26 Feb 2008 02:19 GMT
> Can someone tell me what this error means and how to get rid of it.
>
[quoted text clipped - 4 lines]
> Error 1 No overload for method 'Open' takes '0' arguments
> C:\Projects\Form1.cs 36 13 FormNew

Other have already told you that you are missing some arguments.

C# and VBS behave a bit different regarding missing arguments.

I has this piece of VBS:

Set stm = CreateObject("ADODB.Stream")
stm.Open
stm.Position = 0
stm.Charset = "UTF-8"
stm.WriteText "ABCÆØÅ"
stm.SaveToFile "C:\utf8.txt"
stm.Close

to do the same in C# I had to:

using System;

namespace E
{
    public class Program
    {
        public static void Main(string[] args)
        {
            ADODB.Stream stm = new ADODB.Stream();
            stm.Open(Type.Missing, ADODB.ConnectModeEnum.adModeUnknown,
ADODB.StreamOpenOptionsEnum.adOpenStreamUnspecified, "", "");
            stm.Position = 0;
            stm.Charset = "UTF-8";
            stm.WriteText("ABCÆØÅ", ADODB.StreamWriteEnum.adWriteChar);
            stm.SaveToFile(@"C:\utf8.txt",
ADODB.SaveOptionsEnum.adSaveCreateNotExist);
            stm.Close();
        }
    }
}

You need to do something similar.

Or use something else than ADODB.Stream - I find it hard to
belive that you can not achieve what you want by using the
.NET library.

Arne

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.