| CodeGuru Home | VC++ / MFC / C++ | .NET / C# | Visual Basic | Newsletters | VB Forums | Developer.com |
|
|||||||
| Managed C++ and C++/CLI Discuss Managed C++ and .NET-specific questions related to C++. |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hey...
I've got a stored procedure on a MS SQL db that returns a binary value. It's 15 bytes of hex deta that i need to decode once I get it from the DB. The problem is that when i get it from the DB, it just shows up as a string of "System.Byte[]" and I can't figure out how to get to the actual binary data. Here is my code: OdbcConnection *myCon = new OdbcConnection("Driver={Sql Server};server=localhost;trusted_connection=yes;database=Test;"); try{ myCon->Open(); OdbcCommand *myCmd = new OdbcCommand("{call ccGetCards}",myCon); OdbcDataReader *myReader = myCmd->ExecuteReader(); while (myReader->Read()) { //Binary data is in the 3rd field of the result set Console::WriteLine(myReader->GetValue(2)->ToString()); } myReader->Close(); } catch(OdbcException *myEx) { for (int i=0;i<myEx->Errors->Count;i++) { Console::WriteLine(myEx->Errors->Item[i]->Source,myEx->Errors->Item[i]->Message); } } myCon->Close(); How can I get to the real data? Please help! |
![]() |
| Bookmarks |
|
||||||
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|