Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
B

betedesvosges

@betedesvosges
About
Posts
2
Topics
2
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • How to Set a byte array on a sqlserver database ?
    B betedesvosges

    Hello, I want to set a byte array on a sqlserver database with ado.net but i have an error message : Cannot convert 'signed char *' to 'System::Object ^' What is wrong ? Thanks in advance

    // 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);
    
    //Datas
    SByte \* testByteArray = pkcs12Data->array;
    
    // Parameters
    command->Parameters->Add(gcnew SqlParameter("@myPKCS12", SqlDbType::VarBinary));
    command->Parameters\["@myPKCS12"\]->Value = testByteArray;
    
    // Execution
    int affectedrows = command->ExecuteNonQuery();
    
    // Fermeture connection
    connection->Close();
    
    C / C++ / MFC question csharp database com data-structures

  • Set a Byte Array to a SqlServer database on C++\Cli
    B betedesvosges

    Hello, I have a byte array that i want to set on a sqlserver database with ADO.NET. I have an error message : Cannot convert 'signed char *' to 'System::Object ^' What is wrong ? Thanks in advance.

    // 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);
    
    //Datas
    SByte \* testByteArray = pkcs12Data->array;
    
    // Parameters
    command->Parameters->Add(gcnew SqlParameter("@myPKCS12", SqlDbType::VarBinary));
    command->Parameters\["@myPKCS12"\]->Value = testByteArray;
    
    // Execution
    int affectedrows = command->ExecuteNonQuery();
    
    // Fermeture connection
    connection->Close();
    
    Managed C++/CLI question csharp c++ database com
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups