Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to access DBC stored procs in .Net
Message
De
21/12/2004 15:36:13
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Visual FoxPro et .NET
Divers
Thread ID:
00971118
Message ID:
00971143
Vues:
20
Thanks a lot Dmitry. I have a problem using VFP 9 database and .Net 2005 C# Beta. This is the error: Function is not implemented.

What are the versions that you are using.

>Here is a sample code that I use to call VFP Stored Procedure:
>
>
>string connectionString = "PROVIDER=VFPOLEDB.1;" + "DATA SOURCE=" + strDataLocation + ";UID='';PWD=''";
>string commandText = "My_StoredProc";
>
>OleDbCommand oCommand = new OleDbCommand();
>OleDbConnection OleDbConn2Vfp = new OleDbConnection(connectionString);
>OleDbConn2Vfp.Open();
>oCommand.Connection = OleDbConn2Vfp;
>oCommand.CommandText = commandText;
>oCommand.CommandType = CommandType.StoredProcedure;
>
>// Pass parameters to SP
>oCommand.Parameters.Add( "@Param1Name", strParam1Value );
>oCommand.Parameters.Add( "@Param2Name", strParam2Value );
>oCommand.Parameters.Add( "@Param3Name", strParam3Value );
>
>try
>{
>strReturnXml = (string) oCommand.ExecuteScalar();
>}
>catch
>{
>strErrorMessage = "Failed to execute Stored Procedure";
>}
>finally
>{
>OleDbConn2Vfp.Close();
>}
>
>
>Please let me know if you have any questions about my code.
>
>HTH
ramil
~~ learning to stand still
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform