Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Populating OleDbParameterCollection
Message
De
23/12/2005 13:03:50
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
23/12/2005 04:16:39
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
01080445
Message ID:
01080591
Vues:
11
>I have a class which starts like this:
>
>
>Imports System.Data.OleDb
>
>Public Class Data
>
>    Public oDataAdapter As OleDbDataAdapter
>    Public oDataSet As DataSet
>    Public oDataView As DataView
>    Public cSQL As String
>    Public cConnectionString As String
>    Public nCount As Integer
>    Public oParameters As OleDbParameterCollection
>
>
>To instantiate it, I do something like this:
>
>
>        Dim loDataProvider As Framework.Data = New Framework.Data
>
>
>Now, I need to add some parameters in the collection before doing something else. So, the instantiation code section now contains this:
>
>
>        Dim loDataProvider As Framework.Data = New Framework.Data
>        loDataProvider.oParameters.Add(New OleDbParameter("@Username", lcUsername))
>
>
>This doesn't give any error at design time. But, when I run it, I obtain:
>
>Object reference not set to an instance of an object
>
>Anyone would know what I have to adjust?
Public oParameters As OleDbParameterCollection
...
oParameters = oDataAdapter.SelectCommand.Parameters
oParameters doesn't sound to be a good naming really.
loDataProvider.oDataAdapter.SelectCommand.Parameters.Add( ... )
loDataProvider.oDataAdapter.UpdateCommand.Parameters.Add( ... )
loDataProvider.oDataAdapter.InsertCommand.Parameters.Add( ... )
PS: Might not be right. Thinking C# wrting VB:)
Cetin
Çetin Basöz
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform