Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DataSet Designer vb
Message
 
 
À
02/03/2010 08:12:20
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Versions des environnements
Environment:
VB 9.0
Divers
Thread ID:
01451949
Message ID:
01451962
Vues:
25
>Hi,
>When I create dataset designer generates for me tableadapter code where programmatically setup connection string
>Now I want to use my userdefined function to initconnection instead function which generate designer for me
>
>For this purpose I create new partial class and create also InitConnection function, Then I delete function from desginer vb code
>The problem is.. when I save XSD or build the application designer creates again and again.. and I'v got a compile time error
>
>"Error 11 'Private Sub InitConnection()' has multiple definitions with identical signatures"
>
>The question is - how can I make a SHADOW for designer code
>
>
>
>Namespace Dci_datasetTableAdapters
>
>    Partial Public Class ProductsTableAdapter
>
>        Public Sub New(ByVal tcDBFilename As String)
>            MyBase.New()
>            Dim lcConnectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & tcDBFilename
>            Pmks_connectionstring = lcConnectionString
>            Me.ClearBeforeFill = True
>        End Sub
>
>        Private _pmks_connectionstring As String
>        Public Property Pmks_connectionstring() As String
>            Get
>                Return _pmks_connectionstring
>            End Get
>            Set(ByVal value As String)
>                _pmks_connectionstring = value
>            End Set
>        End Property
>
>        Private Shadows Sub InitConnection()
>            Me._connection = New Global.System.Data.OleDb.OleDbConnection
>            Me._connection.ConnectionString = Pmks_connectionstring 
>        End Sub
>
>    End Class
>
>End Namespace
>
I saw and participated in a thread on this topic in MSDN forum.
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform