开发者

How do I import xml data into a sql server database table in Windows form using c#?

开发者 https://www.devze.com 2023-04-12 21:50 出处:网络
I wanted to display Xml data into the sql server database table. First, I displayed the Xml data using the console appl开发者_StackOverflow社区ication at run time, but now I want to store that XMl dat

I wanted to display Xml data into the sql server database table.

First, I displayed the Xml data using the console appl开发者_StackOverflow社区ication at run time, but now I want to store that XMl data into the database table.

How can I do this?

Himanshu Negi


Well, your XML is supposed to be a string (or it can easily be converted to).
So you can do this:

INSERT INTO your_table (your_col)
SELECT xml_str

I'm assuming you know how to connect to your db and run a SqlCommand after the connection is established...

0

精彩评论

暂无评论...
验证码 换一张
取 消