Hi all,

What wrong with the below snippit of code? I believe I've called the this
function correctly and besides all the errors (immediately below) are
pointed to this snippit of code. Thanks in advance, Steve.

} expected
Invalid token '(' in class, struct, or interface member declaration
Invalid token '(' in class, struct, or interface member declaration
Invalid token '(' in class, struct, or interface member declaration
Invalid token '(' in class, struct, or interface member declaration
Type or namespace definition, or end-of-file expected

public class cls_ConvertThreeDatabases
{
public void ConvertDatabases(string str_Source, string
str_Destination)
{
public string str_SourcePath = @"Provider=Microsoft.Jet.OLEDB.4.0;Data
Source = " + str_Source ;
public string str_DestinationPath = @"Provider=Microsoft.Jet.OLEDB.4.0;Data
Source = " + str_Destination ;

OleDbConnection obj_SourceConn = new OleDbConnection
(str_SourcePath);
OleDbConnection obj_DestinationConn = new OleDbConnection
(str_DestinationPath);

obj_SourceConn.Open();
obj_DestinationConn.Open();

obj_Destination.Close();
obj_Source.Close();

return;
}
}


--
Message posted via DotNetMonster.com
http://www.dotnetmonster.com/Uwe/Forums.aspx/dotnet-ado-net/200509/1

Re: This simple ADO.NET connection is causing errors - HELP!!!! by Steve1

Steve1
Wed Sep 28 06:34:03 CDT 2005

I have included the 'Using System.Data.OleDb' at the very top of the class
file.

Thanks, Steve.


--
Message posted via DotNetMonster.com
http://www.dotnetmonster.com/Uwe/Forums.aspx/dotnet-ado-net/200509/1