Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Call Vfp Database StoreProc with Parameter
Message
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Divers
Thread ID:
00703020
Message ID:
00703460
Vues:
19
Hi Rick,

I think that we can, if we used the '?' Signe like.
OleDbCommand oCommand = new OleDbCommand();
oCommand.Connection = this.oConn;
oCommand.CommandText = "Test(?)";
oCommand.Parameters.Add("NameVar1","StringValueVar1");
I try and it's work for me...

Thank's a lot.
Rock


>With the current VFP OleDb provider you cannot use the full command object functionality. Instead you need to pass parameters by creating literal strings of the Store Proc command:
>
>OleDbCommand oCommand = new OleDbCommand();
>oCommand.Connection = this.oConn;
>oCommand.CommandText = "Test('Salut')";
>
>The problem here is that returning values doesn't work. This will be fixed in the next version of the OleDb driver...
>
>+++ Rick ---
>
>
>>Hi Guys,
>>
>>I want to call a vfp store procedure with parameter and it always give me a ole exception code...
>>
>>Thank's for your help.
>>
>>That's the code i try. Do you saw something Wrong...
>>
>>
>>OleDbConnection oCon = new OleDbConnection(@"provider=vfpoledb;data source=C:\Devellopement\Data\Video.dbc");
>>			
>>OleDbCommand poCmd = new OleDbCommand();
>>poCmd.Connection = oCon;
>>poCmd.CommandText = "[test]";
>>poCmd.CommandType = CommandType.StoredProcedure;
>>
>>OleDbParameter x = new OleDbParameter("@psParam",OleDbType.VarChar);
>>x.Value = "Salut";
>>poCmd.Parameters.Add(x);
>>			
>>poCmd.Connection.Open();
>>string y  = poCmd.ExecuteScalar().ToString();
>>
>>
>>Vfp SP code...
>>
>>
>>PROCEDURE Test(psParam as String) as String
>>	RETURN psParam
>>ENDPROC
>>
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform