Information générale
Titre:
OledbCommand Parameters with Vfp7
Hi guys,
i used c# and vfp 7 as DataBase. i used oledb driver of vfp 7 to communicate and i try to use parameter with the oledbcommand object to call vfp7 storeprocedure.
That's the code that i'm trying to get work.
Do you have a idea or a sugestion ?
Thank's in Advance
Rock
Ex:
OleDbConnection Connection = new OleDbConnection("provider=vfpoledb;data source=C:/Ga.dbc");
OleDbCommand Cmd = new OleDbCommand();
Cmd.Connection = Connection;
Cmd.CommandText = "MyFunction(?)";
OleDbParameter CmdParam = Cmd.CreateParameter();
CmdParam.ParameterName="lnId";
CmdParam.OleDbType = OleDbType.Integer;
CmdParam.Value = 1 ;
Cmd.Parameters.Add(CmdParam);
Connection.Open();
int lnTmp = 0 ;
try
{
lnTmp = (int) Cmd.ExecuteScalar();
}
catch(Exception e)
{
Console.WriteLine(e.Message);
System.Console.ReadLine();
}
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement