datagridview更新数据库问题
代码如下:
#region 数据映射查询
public SqlDataAdapter SQL_Bind(string Select_String, SqlConnection Link_Conn, DataTable SDT, DataGridView DG_Name)
{
DA = new SqlDataAdapter();
SDT = new DataTable();
if (Link_Conn == null) Link_Conn = SQL_Conn;
try
{
SqlCommand SCMD = new SqlCommand(Select_String, Link_Conn);
DA.SelectCommand = SCMD;
DA.Fill(SDT);
DG_Name.DataSource = SDT;
}
catch (Exception err)
{
try
{
int num = err.ToString().IndexOf( "。 ");
MessageBox.Show(err.ToString().Substring(0, num));
}
catch
{
MessageBox.Show(err.ToString());
}
}
Link_Conn.Close();
&nb