1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
// Connexion
SqlConnection ^connection = gcnew SqlConnection(connectString);
connection->Open();
// Requete
String ^ myRequete = "UPDATE COM_PKCS12 SET PKCS12 = @myPKCS12 WHERE ID = '" + System::Convert::ToString(id) + "'";
// Objet Command
SqlCommand ^command = gcnew SqlCommand( myRequete, connection);
//Récupération du tableau de bits
SByte *myDatas = pkcs12Data->array;
// Parameters
command->Parameters->Add(gcnew SqlParameter("@myPKCS12", SqlDbType::VarChar, 1024));
command->Parameters["@myPKCS12"]->Value = myDatas;
// Execution
int affectedrows = command->ExecuteNonQuery();
// Fermeture connection
connection->Close(); |
Partager