本文整理匯總了C#中ADODB.Recordset.Save方法的典型用法代碼示例。如果您正苦於以下問題:C# ADODB.Recordset.Save方法的具體用法?C# ADODB.Recordset.Save怎麽用?C# ADODB.Recordset.Save使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ADODB.Recordset
的用法示例。
在下文中一共展示了ADODB.Recordset.Save方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: bExportDataToXML
// Output data to xml
public static Boolean bExportDataToXML(String sDatabaseLocation, Boolean bDebug)
{
clsLog clsLog_ = new clsLog(msLogFile, msVersionData);
clsError clsError_ = new clsError();
ADODB.Connection conn = new ADODB.Connection();
ADODB.Recordset rs = new ADODB.Recordset();
clsLog_.mLog(Constants.gcInfo, "Exporting data to xml ...");
String sOneLanPropertyfile = sDatabaseLocation + "\\xml\\OneLanProperty.xml";
String sOneLanAccomfile = sDatabaseLocation + "\\xml\\OneLanAccom.xml";
if (bDebug) { clsLog_.mLog(Constants.gcInfo, sIndent + "onelan.bExportDataToXML, sOneLanPropertyfile = " + sOneLanPropertyfile); }
if (bDebug) { clsLog_.mLog(Constants.gcInfo, sIndent + "onelan.bExportDataToXML, sOneLanAccomfile = " + sOneLanAccomfile); }
try
{
// Open connection to database
conn.Open(gcDSN + sDatabaseLocation + "\\" + gsOneLanDatabase);
// Remove previous versions of the files
if (File.Exists(sOneLanPropertyfile)) {File.Delete(sOneLanPropertyfile);}
if (File.Exists(sOneLanAccomfile)) {File.Delete(sOneLanAccomfile);}
// Open the recordset
rs.Open("SELECT * FROM Property", conn, ADODB.CursorTypeEnum.adOpenForwardOnly, ADODB.LockTypeEnum.adLockOptimistic, -1);
rs.Save(sOneLanPropertyfile, ADODB.PersistFormatEnum.adPersistXML);
rs.Close();
rs.Open("SELECT * FROM Accom", conn, ADODB.CursorTypeEnum.adOpenForwardOnly, ADODB.LockTypeEnum.adLockOptimistic, -1);
rs.Save(sOneLanAccomfile, ADODB.PersistFormatEnum.adPersistXML);
rs.Close();
conn.Close();
return true;
}
catch (Exception e)
{
clsError_.mLogError("Problem exporting data to xml", "onelan", "bExportDataToXML", e, msVersionData, msLogFile, false);
return false;
}
}