Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在创建一个c# windows 应用程序,我想将rar或zip文件保存并检索到 sql server。有没有办法将 .rar 或 .zip 文件插入到 SQL Server 并再次取回?请帮我。
创建一个类型的列varbinary(max)。在 C# 中,您可以将内容插入/选择为byte[]. 您可以使用File.ReadAllBytes或File.WriteAllBytes获取文件内容作为byte[]或写入它。
varbinary(max)
byte[]
File.ReadAllBytes
File.WriteAllBytes
请记住:您也可以随时使用 Google!