Binary Type

Last post 08-05-2007 3:23 AM by Thomas Sun – MSFT. 1 replies.

Sort Posts:

  • Binary Type

    08-02-2007, 6:37 AM
    • Loading...
    • SuperSpike
    • Joined on 01-25-2007, 3:35 PM
    • Posts 37

    Hy friends!

    I'm new in WebApplications that have SQL SERVER DB.

    My problem is that...

    In the DataBase I have a table with varbinary column and in the program I want save in this column a value of binary[] variable! How I can make it?

    Another question.... If I want select (by a query in the application) the value of the binary column, where I store it? because if I want select an integer value I take this in a int variable, and if I want select an string value from a DataBase I take this in a string variable..but How I can make it with binary column?

    Thanks in advance!!

     

  • Re: Binary Type

    08-05-2007, 3:23 AM
    Answer


    Hi SuperSpike,

    Based on my understanding, you want to know how to store the data into database with varbinary data type. You also want to know how to contain this varbinary value in the code. If I have misunderstood you, please feel free to let me know.

    If you want to store data, such as image file, into database with varbinary data type, you should read the image into binary data and then insert this binary data into database. If you want to read this binary data in the code, you can use byte[] to contain the data.

    There are a couple of articles: Bind Image from Database to DataGrid (web Application) and Storing Binary Data to Database using ASP.NET 2.0, where you can find more useful information.


    I hope this helps.

     

    This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
Page 1 of 1 (2 items)
Microsoft Communities
Page view counter