在許多情況下
using System;
using System
public class ExecuteScalarExample
{
public static void Main(string[] args)
{
string source =
string select =
SqlConnection conn = new SqlConnection(source);
conn
SqlCommand cmd = new SqlCommand(select
object o = cmd
Console
}
}
該方法返回一個對象
顧名思義
●FOR XML AUTO
●FOR XML RAW
●FOR XML EXPLICIT
Professional SQL Server
using System;
using System
using System
public class ExecuteXmlReaderExample
{
public static void Main(string[] args)
{
string source =
string select =
SqlConnection conn = new SqlConnection(source);
conn
SqlCommand cmd = new SqlCommand(select
XmlReader xr = cmd
xr
string s;
do
{
s = xr
if (s!=
Console
} while (s!=
conn
}
}
注意必須導入System
本例在SQL語句中包含了FOR XML AUTO子句
在SQL子句中
圖
[
From:http://tw.wingwit.com/Article/program/net/201311/15626.html