Re: Search SQL image datatype

Discussion in 'ASP .Net' started by Matt Mercer, Sep 22, 2004.

  1. Matt Mercer

    Matt Mercer Guest

    Hi,

    Well the binary idea was not my idea. It is one of many ways posted on
    the web to upload and download attachments using asp .net/sql. To
    answer another comment, the SQL data type is image and the data is
    converted to binary, but you do not have to store an image. So an
    Excel spreadsheet will sit just fine as long as you same some
    information like filetype to the database as well.

    Let's say we are uploading spreadsheets with serial numbers, possible
    thousands at a time. Later we want to see if we uploaded an Excel with
    one of these numbers. Keywords won't do it here. Suggestions?

    Thanks as always for the help.
    Matt Mercer, Sep 22, 2004
    #1
    1. Advertising

  2. In such a case I'd suggest you parse out the serial numbers upon upload and
    store them in a database table so you can search them normally.

    --
    I hope this helps,
    Steve C. Orr, MCSD, MVP
    http://Steve.Orr.net


    "Matt Mercer" <> wrote in message
    news:...
    > Hi,
    >
    > Well the binary idea was not my idea. It is one of many ways posted on
    > the web to upload and download attachments using asp .net/sql. To
    > answer another comment, the SQL data type is image and the data is
    > converted to binary, but you do not have to store an image. So an
    > Excel spreadsheet will sit just fine as long as you same some
    > information like filetype to the database as well.
    >
    > Let's say we are uploading spreadsheets with serial numbers, possible
    > thousands at a time. Later we want to see if we uploaded an Excel with
    > one of these numbers. Keywords won't do it here. Suggestions?
    >
    > Thanks as always for the help.
    Steve C. Orr [MVP, MCSD], Sep 22, 2004
    #2
    1. Advertising

  3. Okay, you're storing Excel Files as binary data. If you want to read them
    programmatically, you'll have to use the Excel automation COM interface.
    First, you'll have to pull the data out of the database and save it to a
    file. Then open the file with the Excel COM interface, and go from there.
    However, as you have to put it into a file to read it, wouldn't it be best
    to store it initially as a file? In fact, it is faster to use the file
    system to store binary data such as Excel documents, than it is to store and
    retrieve them from a database. You could always simply store the file name
    in the database, thereby giving you a connection to the file itself.

    --
    HTH,
    Kevin Spencer
    ..Net Developer
    Microsoft MVP
    I get paid good money to
    solve puzzles for a living

    "Matt Mercer" <> wrote in message
    news:...
    > Hi,
    >
    > Well the binary idea was not my idea. It is one of many ways posted on
    > the web to upload and download attachments using asp .net/sql. To
    > answer another comment, the SQL data type is image and the data is
    > converted to binary, but you do not have to store an image. So an
    > Excel spreadsheet will sit just fine as long as you same some
    > information like filetype to the database as well.
    >
    > Let's say we are uploading spreadsheets with serial numbers, possible
    > thousands at a time. Later we want to see if we uploaded an Excel with
    > one of these numbers. Keywords won't do it here. Suggestions?
    >
    > Thanks as always for the help.
    Kevin Spencer, Sep 22, 2004
    #3
  4. Matt Mercer

    Greg Burns Guest

    Just to throw this out there (never done it myself)

    From SQL BOL:

    "Full-text Search"

    Index and search certain types of data stored in image columns.
    Using full-text search, you can index and query certain types of data stored
    in image columns. Full-text search uses one of several supported filters to
    interpret the data and extract the text data for indexing and querying. SQL
    Server provides filters for the .doc, .xls, .ppt, .txt, and .htm file
    extensions.

    HTH,
    Greg

    "Matt Mercer" <> wrote in message
    news:...
    > Hi,
    >
    > Well the binary idea was not my idea. It is one of many ways posted on
    > the web to upload and download attachments using asp .net/sql. To
    > answer another comment, the SQL data type is image and the data is
    > converted to binary, but you do not have to store an image. So an
    > Excel spreadsheet will sit just fine as long as you same some
    > information like filetype to the database as well.
    >
    > Let's say we are uploading spreadsheets with serial numbers, possible
    > thousands at a time. Later we want to see if we uploaded an Excel with
    > one of these numbers. Keywords won't do it here. Suggestions?
    >
    > Thanks as always for the help.
    Greg Burns, Sep 22, 2004
    #4
  5. Opening Excel via COM from ASP.NET is not recommended.
    Here's more details:
    http://support.microsoft.com/default.aspx?scid=kb;EN-US;q257757

    Instead you might consider using a 3rd party product to extract the data you
    need.
    Here's one:
    http://www.aspose.com/Products/Aspose.Excel/

    --
    I hope this helps,
    Steve C. Orr, MCSD, MVP
    http://Steve.Orr.net




    "Kevin Spencer" <> wrote in message
    news:%...
    > Okay, you're storing Excel Files as binary data. If you want to read them
    > programmatically, you'll have to use the Excel automation COM interface.
    > First, you'll have to pull the data out of the database and save it to a
    > file. Then open the file with the Excel COM interface, and go from there.
    > However, as you have to put it into a file to read it, wouldn't it be best
    > to store it initially as a file? In fact, it is faster to use the file
    > system to store binary data such as Excel documents, than it is to store
    > and
    > retrieve them from a database. You could always simply store the file name
    > in the database, thereby giving you a connection to the file itself.
    >
    > --
    > HTH,
    > Kevin Spencer
    > .Net Developer
    > Microsoft MVP
    > I get paid good money to
    > solve puzzles for a living
    >
    > "Matt Mercer" <> wrote in message
    > news:...
    >> Hi,
    >>
    >> Well the binary idea was not my idea. It is one of many ways posted on
    >> the web to upload and download attachments using asp .net/sql. To
    >> answer another comment, the SQL data type is image and the data is
    >> converted to binary, but you do not have to store an image. So an
    >> Excel spreadsheet will sit just fine as long as you same some
    >> information like filetype to the database as well.
    >>
    >> Let's say we are uploading spreadsheets with serial numbers, possible
    >> thousands at a time. Later we want to see if we uploaded an Excel with
    >> one of these numbers. Keywords won't do it here. Suggestions?
    >>
    >> Thanks as always for the help.

    >
    >
    Steve C. Orr [MVP, MCSD], Sep 22, 2004
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. dna
    Replies:
    1
    Views:
    1,255
  2. Replies:
    1
    Views:
    609
    =?iso-8859-1?Q?Guillermo_Gonz=E1lez_A.?=
    Jul 21, 2005
  3. Replies:
    2
    Views:
    1,009
  4. Jeff
    Replies:
    2
    Views:
    1,117
    Steve C. Orr [MCSD, MVP, CSM, ASP Insider]
    Apr 16, 2007
  5. Nathan Sokalski

    Saving an image to SQL Server's image datatype

    Nathan Sokalski, Jul 17, 2008, in forum: ASP .Net
    Replies:
    9
    Views:
    29,395
    steve
    Aug 3, 2008
Loading...

Share This Page