怎麼用XML做資料庫c

2021-05-27 15:00:51 字數 958 閱讀 6889

xml實際就是乙個本地簡單的資料庫

我只做了乙個簡單的。。但是道理是一樣的。

//xml檔案資訊

1001

zhangsan男2

lisi

男//實體類。

public class information

set

}private string name;

public string name

set

}private string ***;

public string ***

set

}public information()

public information(string id,string name,string ***)

}//讀取xml裡面的檔案資訊

listlist = new list();

//例項化xml

xmldocument xml = new xmldocument();

//讀取xml檔案

xml.load(@"e:\c#\s2c#\dlcl\列印電腦\mycomputer\xuliehua\xml.xml");  //你的xml位址

string id = "";

string name = "";

string *** = "";

information info = null;

//*******下面開始迴圈讀取xml檔案資訊********/

///foreach (xmlnode node in xml.childnodes)

}info = new information(id, name, ***);

//將資訊儲存至集合

list.add(info);}}

}}xml裡面的所有資訊就是在list集合裡面了。。簡單吧。。嘿嘿。。

當然你可以做多個表和多個字段屬性咯。。

B樹在資料庫怎麼用

首先,b樹不要和二叉樹混淆,在電腦科學中,b樹是一種自平衡樹資料結構,它維護有序資料並允許以對數時間進行搜尋,順序訪問,插入和刪除。b樹是二叉搜尋樹的一般化,因為節點可以有兩個以上的子節點。1 與其他自平衡二進位制搜尋樹不同,b樹非常適合讀取和寫入相對較大的資料塊 如光碟 的儲存系統。它通常用於資料...

用PHP實現XML備份Mysql資料庫

以下是在linux下通過apache php對mysql資料庫的備份的檔案 檔案一 listtable.php 檔案列出資料庫中的所有 供選擇備份 請選擇要備份的 con mysql connect localhost root xswlily lists mysql list tables emb...

原創 資料庫求交集怎麼做?

乙個檔案和標籤的多對多關係表,求取tag1,tag2,tag3下的檔案有哪些?idtag id file id 1tag 1f12 tag 2f13 tag 3f14 tag 1f25 tag 2f26 tag 3f37 tag 1 f3例如,求取符合 tag 1 和 tag 2 下面的所有檔案。通...