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