--表:table --欄位:columsA、columsB、columsC、columsD void Main(){ string sql="select columsA from table"; DataTable dt=SqlHelper.executeQuery(sql); dt.rows[ ...
--表:table
--欄位:columsA、columsB、columsC、columsD
void Main(){
string sql="select columsA from table";
DataTable dt=SqlHelper.executeQuery(sql);
dt.rows[0]["columsA"]="111";
sdaUpdate(sql,dt)
}
public void sdaUpdate(string selectSql,DataTable dt)
{
try
{
SqlCommand sqlCommand = GetSqlConn().CreateCommand();
sqlCommand.CommandText = selectSql;
SqlDataAdapter sdaAdapter = new SqlDataAdapter(sqlCommand);
SqlCommandBuilder scbBuilder = new SqlCommandBuilder(sdaAdapter);
sdaAdapter.Update(dt);
}
catch (Exception ex)
{
}
}