參考
--
try
{
string connectionString = @"Data Source=server_name;database=database_name;Integrated Security=True;";
using (SqlConnection connection = new SqlConnection(connectionString))
{
connection.Open();
Mydb db = new Mydb(connection);
var q = from c in db.Customers
where c.CustomerID.StartsWith("A")
select new { c.CustomerID, c.Phone };
foreach(var c in q)
Debug.WriteLine(c);
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
沒有留言:
張貼留言