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
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.