我正在使用Visual Foxpro 8.0數據庫。我正在使用下面的過程來基於條件匹配從數據庫返回記錄,但它引發了「函數未實現」的錯誤。請幫我這是非常迫切......Visual Foxpro數據庫存儲過程與Oledb提供程序
Foxpro的程序------------------------
爲PROCEDURE FX_Proc_ValidateUser (paramUserName AS Character, paramPassword AS Character)
LOCAL VarUserName AS Character, varXml
VarUserName = IIF(VARTYPE(paramUserName)!="N","",paramUserName)
LOCAL VarPassword AS Character
VarPassword = IIF(VARTYPE(paramPassword)!="N","",paramPassword)
SELECT userinfoid, ;
username, ;
password ;
FROM tm_userinfo.dbf ;
WHERE username = VarUserName AND password = VarPassword ;
INTO CURSOR procResult
varXml = ""
CURSORTOXML("procResult","varXml",1,32,0,"1")
RETURN varXml
ENDPROC
前端代碼調用這個程序------------------
string ConnectionString = "Provider=VFPOLEDB.1;Data Source=C:\Users\raj\Documents\Visual FoxPro Projects\dbFoxMaster.dbc;Collating Sequence=machine;" providerName="System.Data.OleDb.OleDbConnection, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089";
OledbConnection objOleDbConnection = new OleDbConnection(ConnectionString);
objOleDbConnection.Open();
OleDbCommand objOleDbCommand = new OleDbCommand();
objOleDbCommand.CommandType = CommandType.StoredProcedure;
objOleDbCommand.CommandText = "FX_Proc_ValidateUser";
objOleDbCommand.Connection = objOleDbConnection;
objOleDbCommand.Parameters.Add("paramUserName", OleDbType.Char).Value = "abc";
objOleDbCommand.Parameters.Add("paramPassword", OleDbType.Char).Value = "123";
var xmlString = oOleDbCommand.ExecuteScalar().ToString();
DataTable table = new DataTable();
using (var reader = new StringReader(xmlString))
{
var dataSet = new DataSet();
// creating a dataset from the xml
dataSet.ReadXml(reader);
table = dataSet.Tables[0];
}
請告訴我如何使用的OleDbCommand從FoxPro 8.0存儲過程得到結果集, 感謝
也許這個鏈接可以幫助:http://support.microsoft.com/kb/299820 – rene
請建議我... – Shoeb