Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Find method of DataRowCollection
Message
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Divers
Thread ID:
00698365
Message ID:
00698463
Vues:
17
I just testd this code and it works for me. Try it out. I uses VFP7 Tastrade data:
Dim strUpdateSelect As String
Dim strConnection As String = "provider=VFPOLEDB.1 ;data source='C:\PROGRAM FILES\MICROSOFT VISUAL FOXPRO 7\SAMPLES\TASTRADE\DATA\TASTRADE.DBC';password='';user id=''"


' Make connection to VFP database
Dim VFP7Connection As New OleDbConnection()
VFP7Connection.ConnectionString = strConnection
VFP7Connection.Open()

' Create a Command object with select statement
Dim strSelect As [String] = "SELECT * FROM customer"
Dim VFP7SelectCommand As New OleDbCommand(strSelect, VFP7Connection)

' Create a DataAdapter
Dim VFP7DataAdapter As New OleDbDataAdapter()
VFP7DataAdapter.SelectCommand = VFP7SelectCommand

' Create a DataSet
Dim VFP7DataSet As New DataSet()

' Fill the DataSet with table information
VFP7DataAdapter.Fill(VFP7DataSet, "Customer")
VFP7DataAdapter.FillSchema(VFP7DataSet.Tables("Customer"), SchemaType.Mapped)

VFP7Connection.Close()

Dim row As DataRow
Dim PrimaryKeyNumber As String
PrimaryKeyNumber = "CACTU"

row = VFP7DataSet.Tables("Customer").Rows.Find(PrimaryKeyNumber)

MessageBox.Show(row(0).ToString())
>Hi,
>
>I am sure it is not being declared as an array, I am taking the sample code straight from ADO.NET from Microsoft Press, Chapter 6 page 237 - 240. They show several examples of using the Find method, none of which seem to work for me.
>
>Thanks,
>
>Rodney
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform