CURRENT PROJECTS
loading
string ADODBxml = @"<xml xmlns:s='uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882' xmlns:dt='uuid:C2F41010-65B3-11d1-A29F-00AA00C14882' xmlns:rs='urn:schemas-microsoft-com:rowset' xmlns:z='#RowsetSchema'> <s:Schema id='RowsetSchema'> <s:ElementType name='row' content='eltOnly' rs:CommandTimeout='30'> <s:AttributeType name='guest_no' rs:number='1' rs:writeunknown='true'> <s:datatype dt:type='number' rs:dbtype='numeric' dt:maxLength='19' rs:scale='0' rs:precision='17' rs:fixedlength='true' rs:maybenull='false'/> </s:AttributeType> <s:AttributeType name='operator' rs:number='4' rs:writeunknown='true'> <s:datatype dt:type='string' rs:dbtype='str' dt:maxLength='6' rs:fixedlength='true' rs:maybenull='false'/> </s:AttributeType> <s:AttributeType name='date_time' rs:number='5' rs:writeunknown='true'> <s:datatype dt:type='dateTime' rs:dbtype='timestamp' dt:maxLength='16' rs:scale='3' rs:precision='23' rs:fixedlength='true' rs:maybenull='false'/> </s:AttributeType> <s:extends type='rs:rowbase'/> </s:ElementType> </s:Schema> <rs:data> <z:row guest_no='5519000' operator='JDENAR' date_time='2003-12-22T10:00:51'/> </rs:data> </xml>"; Type adoStreamType = Type.GetTypeFromProgID("ADODB.Stream"); object adoStream = Activator.CreateInstance(adoStreamType); adoStreamType.InvokeMember("Open", System.Reflection.BindingFlags.InvokeMethod, null, adoStream, new object[] {}); adoStreamType.InvokeMember("WriteText", System.Reflection.BindingFlags.InvokeMethod, null, adoStream, new object[] { ADODBxml }); adoStreamType.InvokeMember("Position", System.Reflection.BindingFlags.SetProperty, null, adoStream, new object[] { 0 }); Type adoRecordsetType = Type.GetTypeFromProgID("ADODB.Recordset"); object adoRecordset = Activator.CreateInstance(adoRecordsetType); adoRecordsetType.InvokeMember("Open", System.Reflection.BindingFlags.InvokeMethod, null, adoRecordset, new object[] {adoStream}); OleDbDataAdapter odb = new OleDbDataAdapter(); DataSet ods = new DataSet(); odb.Fill(ods, adoRecordset, "data"); foreach(DataTable t in ods.Tables){ Console.Write("<table border=1>"); foreach(DataRow r in t.Rows){ foreach(DataColumn c in t.Columns){ Console.Write("<tr><td>" + c + "</td><td> " + r[c] + "</td></tr>\n"); } } Console.Write("</table>"); }
guest_no | 5519000 |
operator | JDENAR |
date_time | 12/22/2003 10:00:51 AM |