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

Welcome to UtterAccess! Please ( Login   or   Register )

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



Posts: 91
Joined: 18-May 04



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: 17,108
Joined: 4-December 03
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
 


RSSSearch   Top   Lo-Fi    31st July 2015 - 12:24 PM