Activator.CreateInstance() for OleDbConnection 
Author Message
 Activator.CreateInstance() for OleDbConnection

When I try to create OleDbConnection with Activator.CreateInstance(null,
"OleDbConnection"), I get error, which says, that type not found. If I try
to use CreateInstance("System.Data", "OleDbConnection") form, when I get
error, that assambly not found. So how to solve this problem?


Tue, 12 Apr 2005 23:53:42 GMT  
 Activator.CreateInstance() for OleDbConnection
Gytis,

    First, why not just set a reference and use early binding?

    Assuming you still want to do this, the name "System.Data" is not the
full asssembly name.  I believe that you need to use the full name of the
assembly.  You can see this by using the FullName property on the Assembly
class (if you want to check out what it is for System.Data.dll).

    Hope this helps.

--
               - Nicholas Paldino [.NET/C# MVP]


Quote:
> When I try to create OleDbConnection with Activator.CreateInstance(null,
> "OleDbConnection"), I get error, which says, that type not found. If I try
> to use CreateInstance("System.Data", "OleDbConnection") form, when I get
> error, that assambly not found. So how to solve this problem?



Tue, 12 Apr 2005 23:26:30 GMT  
 Activator.CreateInstance() for OleDbConnection
Have you tried "System.Data.OleDb" in place
os "System.Data"?

Quote:
>-----Original Message-----
>When I try to create OleDbConnection with

Activator.CreateInstance(null,
Quote:
>"OleDbConnection"), I get error, which says, that type
not found. If I try
>to use CreateInstance("System.Data", "OleDbConnection")
form, when I get
>error, that assambly not found. So how to solve this
problem?

>.



Wed, 13 Apr 2005 00:29:33 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Activator.CreateInstance

2. Activator.CreateInstance

3. Activator.CreateInstance...

4. calling Stored procedure using OleDbConnection

5. Component Services, OleDbConnection.Open(), and Oracle

6. marshalling OleDbConnection objects...

7. Marshalling OleDbConnection objects...

8. Oledbconnection, SQlconnection interactivity

9. How do I connect to an ODBC OleDbConnection

10. OleDBConnection Sample

11. System::Activator::CreateInstance?

12. System.Activator.CreateInstance() - evidence?

 

 
Powered by phpBB® Forum Software