General information
Title:
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();
}
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only