Creating database from xml
-
Is any way to build a table base on xml/xsd. Is any way to build xsd from xml. also xsd has some limitation like lentgh of string field. Any idea ? So Thanks
After opening a new xml file write: Then from XML menu select CreateSchema to create xsd file, To determine the Key field right click the element in the xml schema,Add,NewKey. In code-behind page: void GetUserData(string userID) { DataSet ds=new DataSet(); string strpath=Server.MapPath(Request.ApplicationPath); ds.ReadXmlSchema(strpath+"\\xmlfilename.xsd"); ds.ReadXml(strpath+"\\xmlfilename.xml"); DataRow dr=ds.Tables["User"].Rows.Find(userID); string username=dr["UserName"].ToString(); } void SetUserData(string userID) { string strpath=Server.MapPath(Request.ApplicationPath); DataSet ds=new DataSet(); ds.ReadXml("xmlfilename.xml"); DataRow dr=ds.Tables["User"].Rows.Find(userID); dr["UserName"]="user1name"; ds.WriteXml(strpath+"\\xmlfilename.xml") } I am too late but i will never give up
-
After opening a new xml file write: Then from XML menu select CreateSchema to create xsd file, To determine the Key field right click the element in the xml schema,Add,NewKey. In code-behind page: void GetUserData(string userID) { DataSet ds=new DataSet(); string strpath=Server.MapPath(Request.ApplicationPath); ds.ReadXmlSchema(strpath+"\\xmlfilename.xsd"); ds.ReadXml(strpath+"\\xmlfilename.xml"); DataRow dr=ds.Tables["User"].Rows.Find(userID); string username=dr["UserName"].ToString(); } void SetUserData(string userID) { string strpath=Server.MapPath(Request.ApplicationPath); DataSet ds=new DataSet(); ds.ReadXml("xmlfilename.xml"); DataRow dr=ds.Tables["User"].Rows.Find(userID); dr["UserName"]="user1name"; ds.WriteXml(strpath+"\\xmlfilename.xml") } I am too late but i will never give up
-
So Thanks I have three question. can I build select,insert,update and create table query from xml. how can I Create Schema without visual studio and what about relational database. thanks