UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Inheriting Sqlconnection In Vb.net    
 
   
ngulube
post Jan 9 2012, 11:28 AM
Post #1

UtterAccess Enthusiast
Posts: 91



Is there a way to inherit the "SqlConnection" object ? The code I have written as below generates the error "Inherits System.Data.SqlClient.SqlConnection"

==========The sample Code ================
Module ConnectivityFlexibility
Public Class ConClass
Inherits System.Data.SqlClient.SqlConnection
End Class
End Module
======================================
"Thanks in advance!
Go to the top of the page
 
+
datAdrenaline
post Jan 9 2012, 02:03 PM
Post #2

UtterAccess Editor
Posts: 16,705
From: Northern Virginia, USA



Since the SqlConnection class can not be inherited, the direct answer to your question is "no".

However, you could pass in an SqlConnection object in your classes' constructor, then you have access to the SqlConnection class through your class and a property.


--------------------
Brent Spaulding | datAdrenaline | Access MVP
It's all very well to tell us to forgive our enemies; our enemies can never hurt us very much. But oh, what about forgiving our friends? - Willa Cather; As always - Pay it Forward!
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Search  ·  Go to Top  ·  Lo-Fi Version Time is now: 23rd July 2014 - 08:57 AM