午夜国产狂喷潮在线观看|国产AⅤ精品一区二区久久|中文字幕AV中文字幕|国产看片高清在线

    數(shù)據(jù)庫生成xml的兩個方法
    來源:易賢網(wǎng) 閱讀:844 次 日期:2014-10-08 08:48:57
    溫馨提示:易賢網(wǎng)小編為您整理了“數(shù)據(jù)庫生成xml的兩個方法”,方便廣大網(wǎng)友查閱!

    第一個示例方法:

    1 sqlconnection conn = new sqlconnection();

    2 conn.connectionstring = server=127.0.0.1;user

    id=sa;password=fdahgdrethj31313210212121;

    database=northwind;persist security info=true;

    3 conn.open();

    4 sqldataadapter da = new sqldataadapter(select * from 表, conn);

    5 sqlcommandbuilder thisbulder = new sqlcommandbuilder(da);

    6 dataset ds = new dataset();

    7 da.fill(ds);

    8 ds.writexml(@c:\temp.xml);

    第二個示例方法:

    1 private void writexmltofile(dataset thisdataset)

    2 {

    3 if (thisdataset == null) { return; }

    4 // create a file name to write to.

    5 string filename = myxmldoc.xml;

    6 // create the filestream to write with.

    7 system.io.filestream myfilestream = new system.io.filestream

    8 (filename, system.io.filemode.create);

    9 // create an xmltextwriter with the filestream.

    10 system.xml.xmltextwriter myxmlwriter =

    11 new system.xml.xmltextwriter

    (myfilestream, system.text.encoding.unicode);

    12 // write to the file with the writexml method.

    13 thisdataset.writexml(myxmlwriter);

    14 myxmlwriter.close();

    15 }

    更多信息請查看IT技術(shù)專欄

    更多信息請查看數(shù)據(jù)庫
    易賢網(wǎng)手機網(wǎng)站地址:數(shù)據(jù)庫生成xml的兩個方法
    由于各方面情況的不斷調(diào)整與變化,易賢網(wǎng)提供的所有考試信息和咨詢回復(fù)僅供參考,敬請考生以權(quán)威部門公布的正式信息和咨詢?yōu)闇?zhǔn)!

    2025國考·省考課程試聽報名

    • 報班類型
    • 姓名
    • 手機號
    • 驗證碼
    關(guān)于我們 | 聯(lián)系我們 | 人才招聘 | 網(wǎng)站聲明 | 網(wǎng)站幫助 | 非正式的簡要咨詢 | 簡要咨詢須知 | 新媒體/短視頻平臺 | 手機站點 | 投訴建議
    工業(yè)和信息化部備案號:滇ICP備2023014141號-1 云南省教育廳備案號:云教ICP備0901021 滇公網(wǎng)安備53010202001879號 人力資源服務(wù)許可證:(云)人服證字(2023)第0102001523號
    云南網(wǎng)警備案專用圖標(biāo)
    聯(lián)系電話:0871-65099533/13759567129 獲取招聘考試信息及咨詢關(guān)注公眾號:hfpxwx
    咨詢QQ:1093837350(9:00—18:00)版權(quán)所有:易賢網(wǎng)
    云南網(wǎng)警報警專用圖標(biāo)