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