1 回答
TA贡献1878条经验 获得超4个赞
解决方案在这里:
for (int i = 0; i < dataManipulator.columnCheckedList.CheckedItems.Count; i++)
{
addRecordDataGridView.Rows.Add(visibleColumns[i]);
getSqlColumnTypes += $"'{visibleColumns[i]}'";
SqlDataAdapter sqladapter = new SqlDataAdapter($"{getSqlColumnTypes}", loginForm.connection = new SqlConnection($"Server = {loginForm.serverName.Text }; Database = { loginForm.DBNames.SelectedItem}; Trusted_Connection = True"));
DataSet dt = new DataSet();
sqladapter.Fill(dt);
addRecordDataGridView.Rows[i].Cells[1].Value = dt.Tables[0].Rows[0][0].ToString();
addRecordDataGridView.Rows[i].Cells[2].Tag = new DataGridViewTextBoxColumn();
}
- 1 回答
- 0 关注
- 83 浏览
添加回答
举报