Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Stored Procedure with reference Parameter called by OLED
Message
 
 
To
20/08/2008 06:00:30
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro and .NET
Miscellaneous
Thread ID:
01340318
Message ID:
01340373
Views:
11
This is the thread I was thinking about Re: Oledbconnection between C# and .DBC can read output para Thread #1316082
>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");
>
>
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform