Get connection string by connection’s name
string conn = ConfigurationManager.ConnectionStrings["NorthwindConnectionString"].ConnectionString;
or
string conn = ConfigurationManager.ConnectionStrings[1].ToString();
Use Clone method to copy the table structure (Schema)
DataTable dtProductCopy = new DataTable();
dtProductCopy = dtProduct.Clone();
Use the ImportRow method to copy from Product table to its clone
for (int i = 0; i < dtProduct.Rows.Count; ++i)
{
dtProductCopy.ImportRow(dtProduct.Rows[i]);
}
Environment.GetEnvironmentVariable("SystemRoot");
or
Environment.GetEnvironmentVariable("windir");
System.Security.Principal.WindowsIdentity.GetCurrent().Name;
System.Windows.Forms.SystemInformation.ComputerName.ToString();
or
System.Environment.MachineName;