SqlConnectionconn = newsql connection(" SERVER =。;UID = saPWD =萨;数据库= pubs”);sqldata adapter adapter = newsql dataadapter(" SELECT * from sales ",conn);SqlCommandBuildercmdbuilder = newSqlCommandBuilder(适配器);DataSetds = newDataSet适配器。填充(ds);适配器。UpdateCommand=cmdbuilder。GetUpdateCommand适配器。更新(ds,ds。表[0]。TableName);