By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,636 Members | 1,693 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,636 IT Pros & Developers. It's quick & easy.

Partial Classes - Identical Signatures

P: n/a
I want to extend the auto-generated tableadapter classes created by
the dataset designer.

I'd like to add a connectionString property so I can set this outside
my class library. I've got Get/Set code for that in my partial class.

Is it possible to "REPLACE" method calls in a partial class? In other
words, I'd like to replace the InitConnection() Sub in the generated
class with my own in my partial class.

I basically want to change the original in the auto-generated code:

Private Sub InitConnection()
Me._connection = New System.Data.SqlClient.SqlConnection
Me._connection.ConnectionString =
Global.FVE.DAL.My.MySettings.Default.MyConnectionS tring
End Sub

To This in my partial:

Private Sub InitConnection()
Me._connection = New System.Data.SqlClient.SqlConnection
If m_ConnectionString = Nothing Then
Me._connection.ConnectionString =
Global.FVE.DAL.My.MySettings.Default.MyConnectionS tring
Else
Me._connection.ConnectionString = m_ConnectionString
End If
End Sub

Is this possible? Or should I just init the _connection variable in my
ConnectionString Set?

May 23 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
daokfella <jj******@hotmail.comwrote in news:1179897248.726818.108860
@k79g2000hse.googlegroups.com:
I want to extend the auto-generated tableadapter classes created by
the dataset designer.

I'd like to add a connectionString property so I can set this outside
my class library. I've got Get/Set code for that in my partial class.

Is it possible to "REPLACE" method calls in a partial class? In other
words, I'd like to replace the InitConnection() Sub in the generated
class with my own in my partial class.
To replace amethod you're better off inheriting the class.
May 23 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.