Results 1 to 2 of 2

Thread: Can you store a .reg file in a sql db with C#

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2006
    Posts
    108

    Can you store a .reg file in a sql db with C#

    Hello,

    I'm looking for a solution to store .reg files in a database or another method.

    I'm new to this, so I do not know if you can store a file inside a sql database.

    I know that it can hold text and numbers, but did not know about file data.

    Second, I know that I can store these files in a directory, but wanted to get some advice from the readers of this forum.

    Thanks for you help,

    -Mike

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Can you store a .reg file in a sql db with C#

    If you want to store binary files in a SQL Server database then you can do so using the varbinary data type. The binary data can be stored in the table itself or, in SQL Server 2008, you can set the FILESTREAM attribute (I don't know the details as I've never done it) to store only a reference in the table and the file contents elsewhere.

    That said, given that REG files contain only text, it might be just as easy to store the file contents in a varchar column as text.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width