using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Configuration;
namespace LINS_Samples
{
#if DEBUG
class OutputWriter : System.IO.TextWriter
{
public override System.Text.Encoding Encoding
{
get { return null; }
}
public override void WriteLine(string value)
{
// [出力]ウィンドウに表示
System.Diagnostics.Debug.WriteLine(value);
}
}
#endif
class Program
{
static void Main(string[] args)
{
var connectionString = ConfigurationManager.ConnectionStrings["NorthwindConnectionString"].ConnectionString;
Console.WriteLine("{0}", connectionString);
Console.ReadLine();
using (var db = new DataClasses1DataContext())
{
db.Log = Console.Out;//Oupput windowに表示する設定
var q = from orders in db.Orders
select new { orders.OrderDate,orders.ShipName };
var q2 = from orDetail in db.Order_Details
select new { orDetail.ProductID,orDetail.Quantity };
//Debug!
System.Diagnostics.Debug.WriteLine(q);
System.Diagnostics.Debug.WriteLine(q2);
Console.WriteLine(q);
Console.WriteLine(q2);
}
//http://blogs.bitlan.net/ito/?p=1474
}
}
}
0 件のコメント:
コメントを投稿