Using Statement and ConnectionManager in VB

Using Statement and ConnectionManager in VB

Old forum URL: forums.lhotka.net/forums/t/5440.aspx


xxxJasonxxx posted on Monday, September 22, 2008

I'm trying to start using the ConnectionManager and I'm struggling a bit.  Can someone post a Visual Basic "Using" statement for the CSLA's ConnectionManger class?  I can't figure out the syntax at the end of the first line - I keep getting the blue squiggly line underneath it.  I have to be missing something super simple.

Using objConnectionManager ........????????.......

End Using

sergeyb replied on Monday, September 22, 2008

Is this what you are looking for:

 

      Using manager As Csla.Data.ConnectionManager(Of SqlConnection) = Csla.Data.ConnectionManager(Of SqlConnection).GetManager("DBConnString", True)

 

 

      End Using

 

Sergey Barskiy

Principal Consultant

office: 678.405.0687 | mobile: 404.388.1899

Magenic ®

Microsoft Worldwide Partner of the Year | Custom Development Solutions, Technical Innovation

 

From: xxxJasonxxx [mailto:cslanet@lhotka.net]
Sent: Monday, September 22, 2008 9:54 AM
To: Sergey Barskiy
Subject: [CSLA .NET] Using Statement and ConnectionManager in VB

 

I'm trying to start using the ConnectionManager and I'm struggling a bit.  Can someone post a Visual Basic "Using" statement for the CSLA's ConnectionManger class?  I can't figure out the syntax at the end of the first line - I keep getting the blue squiggly line underneath it.  I have to be missing something super simple.

Using objConnectionManager ........????????.......

End Using



ayubu replied on Monday, September 22, 2008

AM far from any reference may be this   can help

 

Using objConnectionManager =ConnectionManager(of sqlclient.sqlconnection).getmanager("DatabaseKey")

dim cm as sqlcommand=objConnectionManager.connection.CreateCommand

End Using

 

Note:

DatabaseKey can be either a complete connection string

Or

A connectionstring string key name in the configuration file

xxxJasonxxx replied on Monday, September 22, 2008

Thanks....that was what I needed.  I was struggling with what to put in with the "(Of .....)".

Now that I see it, maybe it should have been obvious.  Thanks for the help.

Copyright (c) Marimer LLC