Advertisement
razdolbaev

Untitled

Jul 9th, 2020
1,050
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.23 KB | None | 0 0
  1.                         dataAdapter.Fill(dataSet);
  2.                         string stsql = "INSERT INTO tech.rel_zakaz_doc(id_zakaz, id_doc) VALUES(:p1, :p2)";
  3.                         NpgsqlDataAdapter da = new NpgsqlDataAdapter(??????????????????????);
  4.                         da.InsertCommand = new NpgsqlCommand(stsql, pqconn);
  5.                         da.InsertCommand.Parameters.Add(new NpgsqlParameter("v1", NpgsqlDbType.Integer));
  6.                         da.InsertCommand.Parameters.Add(new NpgsqlParameter("v2", NpgsqlDbType.Integer));
  7.                         da.InsertCommand.Parameters[0].Direction = ParameterDirection.Input;
  8.                         da.InsertCommand.Parameters[1].Direction = ParameterDirection.Input;
  9.                         da.InsertCommand.Parameters[0].SourceColumn = "id_zakaz";
  10.                         da.InsertCommand.Parameters[1].SourceColumn = "id_doc";
  11.  
  12.                         DataTable firstTable = dataSet.Tables[0];
  13.                         if (firstTable != null)
  14.                         {
  15.                             da.Update(firstTable);//аргументом может быть таблица, набор записей
  16.                             firstTable.Dispose();
  17.                         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement