Try this:
string strConnect = SMDBSupport.SMInstanceStorage.GetInstanceConnectionString("MyDatabase");
using (SqlConnection con = new SqlConnection(strConnect))
{
try
{
con.Open();
using (SqlDataAdapter da = new SqlDataAdapter("SELECT * FROM MyTable", con))
{
DataTable dt = new DataTable();
da.Fill(dt);
dt.Columns.Add("My New Column", typeof(string)).SetOrdinal(0);
myDataGridView.DataSource = dt;
}
}
catch (Exception ex)
{
Debug.WriteLine(ex.ToString());
}
}
You can then set the values of your DT to the text file lines.