Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Stored Procedure with reference Parameter called by OLEDB
Message
From
20/08/2008 06:00:30
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro and .NET
Title:
Stored Procedure with reference Parameter called by OLEDB
Miscellaneous
Thread ID:
01340318
Message ID:
01340318
Views:
61
Hi!

We use the VFP DBC with c#.NET. One Stored Procedure gives us back values by Reference Parameters.

Bud we've only get an empty string back.

Any Idea to solve the Problem?
           if (curCon.State == ConnectionState.Open)
            {


                OleDbCommand command = curCon.CreateCommand();
                command.CommandType = CommandType.StoredProcedure;
                command.CommandText = "sp_LongNextInternalNumber";


                // Erster Parameter
                IDbDataParameter para = command.CreateParameter();

                para.Direction = ParameterDirection.Input;
                para.DbType = DbType.String;
                para.Size = 80;
                para.ParameterName = "tcTableName";
                para.Value = "Logbuch";
                command.Parameters.Add(para);

                // Zweiterparameter = Rückgabewert!
                IDbDataParameter resultpara = command.CreateParameter();

                resultpara.Direction = ParameterDirection.InputOutput;
                resultpara.DbType = DbType.AnsiString;
                resultpara.Size = 15;
                resultpara.Value = "              ";
                resultpara.ParameterName = @"@tcReferenzLfdNrRueckgabe";
                command.Parameters.Add(resultpara);

                try
                {
                    command.ExecuteNonQuery();
                }
                catch (OleDbException exception)
                {

                }


                string lfdnr = resultpara.Value.ToString();

                MessageBox.Show(lfdnr, "lfdnr");
Jörg Schneider
Joerg.Schneider@SMARTCRM.de
SMARTCRM CRM powered by MS Visual FoxPro
SMARTCRM GmbH
Next
Reply
Map
View

Click here to load this message in the networking platform