Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Calling VFP Stored Procedure ?
Message
General information
Forum:
ASP.NET
Category:
ADO.NET
Title:
Calling VFP Stored Procedure ?
Miscellaneous
Thread ID:
00712424
Message ID:
00712424
Views:
44
I have a simple stored procedure in my VFP7 DBC for inserting data into a table. I am trying to execute the stored procedure by passing parameters only. The error I get is
"
An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in system.data.dll
"

Why is that?

c# code:
using System;
using System.Data;
using System.Data.OleDb;
OleDbConnection oConn = new OleDbConnection(cConnString);
try 
{ oConn.Open(); }
catch(Exception oErr) 
{ System.Windows.Forms.MessageBox.Show("\n" + oErr.Message + "\n"); }
System.Data.OleDb.OleDbCommand oCmd = new OleDbCommand();
oCmd.Connection = oConn;
oCmd.CommandType = CommandType.StoredProcedure;
oCmd.Parameters.Add(new OleDbParameter("cInputID",OleDbType.Char,60,"cInputID"));
oCmd.Parameters.Add(new OleDbParameter("cInputResult",OleDbType.Char,4096,"cInputResult"));
string cRetVal = oCmd.ExecuteScalar().ToString();
VFP Stored Procedure:
	Function PutResult
	Lparameters ;
		cInputID as String , cInputResult as String
		If VarType(cInputID) != "C"
			Return 0
		EndIf
		If VarType(cInputResult) != "C"
			Return 0
		EndIf
		If Len(cInputID)< 1
			Return 0
		EndIf
		If Len(cInputID)> 24000
			Return 0
		EndIf		
		Local cIns as String
		cIns =	"insert into result(cid,mdata) " + ;
				"values " + ;
				"('" + cInputID + "','" + ;
				cInputResult + "')"
		&cIns
		Return 1
	EndFunc
Next
Reply
Map
View

Click here to load this message in the networking platform