回覆列表
  • 1 # 你永遠追不上的巨人

    string dataDir = AppDomain.CurrentDomain.BaseDirectory; if (dataDir.EndsWith(@"\bin\Debug\") || dataDir.EndsWith(@"\bin\Release\")) { dataDir = System.IO.Directory.GetParent(dataDir).Parent.Parent.FullName; AppDomain.CurrentDomain.SetData("DateDirectory", dataDir); }using (SqlConnection conn = new SqlConnection(@"Data Source=.\SQLEXPRESS;AttachDBFilename=|DataDirectory|\Database1.mdf;Integrated Security=True;User Instance=True")) { conn.Open(); Console.WriteLine("開啟資料庫成功"); Console.ReadKey();

  • 中秋節和大豐收的關聯?
  • 註冊諮詢工程師的報考條件和免考條件是什麼?