UtterAccess.com
We have detected that you are using an unsupported web browser. We recommend you to upgrade your web browser to get the most from UtterAccess forums.
Why should and how can I upgrade?
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,746
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.
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: 25th October 2014 - 08:48 PM