class Program
{
private const string Sqlconnstr = "Data Source=.;Initial Catalog = LINQtoSQL;UID = Scarface;PWD = kaka1983513!;";
static void Main(string[] args)
{
var dataContext = new DataContext(Sqlconnstr);
var books = dataContext.GetTable<Book>();
var query = from book in books
select book;
var list = query.ToList(); //If i uncomment this line,i can't get the full string without 'PWD = 123456'.
Console.WriteLine(dataContext.Connection.ConnectionString);
Console.ReadLine();
}
}
我怎樣才能得到充分的字符串'PWD = 123456'
後query.ToList()
命令。爲什麼DataContext.Connection.ConnectionString無法得到密碼
@Vishal Suthar:謝謝 – Scarface