using System;
using System.Data;
class Program
{
static void Main()
{
DataTable table1 = new DataTable("customer");
table1.Columns.Add("name");
table1.Columns.Add("id");
table1.Rows.Add("onj1", 1);
table1.Rows.Add("onj2", 2);
DataTable table2 = new DataTable("sale");
table2.Columns.Add("id");
table2.Columns.Add("goods");
table2.Rows.Add(1, "볼펜");
table2.Rows.Add(2, "연필");
DataSet set = new DataSet("office");
set.Tables.Add(table1);
set.Tables.Add(table2);
// XML형태로 출력
Console.WriteLine(set.GetXml());
}
}
[결과]
<office>
<customer>
<name>onj1</name>
<id>1</id>
</customer>
<customer>
<name>onj2</name>
<id>2</id>
</customer>
<sale>
<id>1</id>
<goods>볼펜</goods>
</sale>
<sale>
<id>2</id>
<goods>연필</goods>
</sale>
</office>
![]() | ![]() ![]() | 12-27 | 1691 | |
![]() | ![]() ![]() | 12-11 | 1207 | |
53 | ![]() ![]() | 03-15 | 966 | |
52 | ![]() ![]() | 01-31 | 1126 | |
51 | ![]() ![]() | 01-31 | 889 | |
50 | ![]() ![]() | 01-31 | 816 | |
49 | ![]() ![]() | 01-19 | 1105 | |
48 | ![]() ![]() | 01-11 | 991 | |
47 | ![]() ![]() | 01-03 | 1485 | |
46 | ![]() ![]() | 12-27 | 1691 | |
45 | ![]() ![]() | 12-19 | 1236 | |
44 | ![]() ![]() | 12-14 | 1230 | |
43 | ![]() ![]() | 12-11 | 1207 | |
42 | ![]() ![]() | 12-09 | 973 | |
41 | ![]() ![]() | 12-01 | 1145 | |
40 | ![]() ![]() | 12-01 | 1373 | |
39 | ![]() ![]() | 12-01 | 860 |
댓글 없음:
댓글 쓰기