Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DataView returned object problem
Message
De
06/12/2005 16:16:45
Keith Payne
Technical Marketing Solutions
Floride, États-Unis
 
 
À
06/12/2005 15:56:29
Information générale
Forum:
ASP.NET
Catégorie:
Migration
Divers
Thread ID:
01075482
Message ID:
01075488
Vues:
20
This message has been marked as the solution to the initial question of the thread.
>I am having a problem on the last line of the following code since I migrated to VS 2005:
>
>
>Imports System.Data.OleDb
>
>Public Class Data
>
>    Inherits ErrorHandler
>
>    ' SQL adapter into a DataView
>    ' expC1 SQL command
>    ' expC2 Path of the table
>    Public Shared Function VFPSQLAdapterDataView(ByVal tcSQL As String, ByVal tcTable As String) As DataView
>        Dim loData As DataSet
>        Dim loView As DataView
>        ErrorInitialize()
>        loData = New DataSet
>        Try
>            Dim loDT As New OleDbDataAdapter(tcSQL, _
>            "Provider=VFPOLEDB.1;Data Source=" + tcTable + ";Password='';Collating Sequence=MACHINE")
>
>            loDT.Fill(loData, "Temp")
>
>            ' Get it into a view
>            loView = loData.Tables("Temp").DefaultView
>
>        Catch loError As Exception
>            ErrorSetup(loError)
>        End Try
>
>        Return loView
>    End Function
>
>
>In the compiler, I also have something like:
>
>Variable 'loView' is used before it has been assigned a value. A null reference exception could result at runtime.

Michel,

Change
Dim loView As DataView
to
Dim loView As DataView = Nothing
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform