私は c# プログラマーです。現在、datagrid-viewer の sql データに 5 つの列 (fileId、filePath、authorName、fileContent、DateSend) のうち 3 つを追加しようとしています。fileId および fileContent 列は非表示になっています。どうもありがとうございました!
con = new SqlConnection("Data Source=LEO-PC\\SQLEXPRESS;Initial Catalog = datashare;Integrated Security = True");
cmd = new SqlCommand("select * from maintable", con);
con.Open();
SqlDataReader sqlRead;
try
{
sqlRead = cmd.ExecuteReader();
while (sqlRead.Read())
{
//Adding to datagrid
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
finally
{
con.Close();
}