一個簡單的撈取資料庫資料的範例語法
(一)
SqlConnection conn = new SqlConnection();
try
{
conn.ConnectionString = "Data Source=.\\SqlExpress;Initial Catalog=NorthWind;
Integrated Security=true";
conn.Open();
SqlCommand cmd = new SqlCommand();
cmd.Connection = conn;
cmd.CommandText = "SELECT * FROM Order";