Assigning null to OleDb.OleDbConnection

  • Thread starter Thread starter John
  • Start date Start date
J

John

Hi

How can I assign a null value to a variable of type OleDb.OleDbConnection?

Thanks

Regards
 
John said:
How can I assign a null value to a variable of type
OleDb.OleDbConnection?

dim con as OleDb.OleDbConnection

'...
con = Nothing

That's it?


Armin
 
Hi

How can I assign a null value to a variable of type OleDb.OleDbConnection?

Thanks

Regards

C#'s "null" should be replaced with "Nothing" in Visual Basic.

But if you concerned with terminating the connection you should really
call connection.Close() or connection.Dispose() or just wrap the
connection object in a using block

Thanks,

Seth Rowe
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top