SUMMARY
The
GetChunk and the
AppendChunk methods are not available in ADO.NET on
DataReader columns,
DataSet columns, or
Command parameters. This article describes how to use Visual C# .NET to read and write binary large object (BLOB) fields.
Requirements
The following list outlines the recommended hardware, software, network infrastructure, and service packs that are required:| • | Microsoft Windows 2000 Professional, Windows 2000 Server, Windows 2000 Advanced Server, or Windows NT 4.0 Server |
| • | Microsoft Visual Studio .NET |
| • | Microsoft SQL Server |
Create the Project
| 1. | Add a table named MyImages to your SQL Server Northwind database. Include the following fields in your table:
| ||||||
| 2. | Start Visual Studio .NET, and then create a new Visual C# Windows Application project. | ||||||
| 3. | Drag two Button controls from the toolbox to the default form, Form1. | ||||||
| 4. | In the Properties window, change the Text property of Button1 to Save to Database (from File), and then change the Text property of Button2 to Save to File (from Database). | ||||||
| 5. | Add the following code to the top of the Code window: | ||||||
| 6. | Double-click Button1, and then add the following code to the Button1_Click event handler. Note Uid <user name> must have permissions to perform these operations on the database. | ||||||
| 7. | Double-click Button2, and then add the following code to the Button2_Click event handler. Note Uid <user name> must have permissions to perform these operations on the database. | ||||||
| 8. | Press F5 to compile and to run the application. | ||||||
| 9. | Click Save to Database (from File) to load the image, C:/WinNT/Gone Fishing.bmp, into the SQL Server Image field. | ||||||
| 10. | Click Save to File (from Database) to save the data from the SQL Server Image field back to a file. |
博客围绕C#项目展开,提及了相关要求及项目创建过程,还涉及SQL Server的应用,可能与数据处理等信息技术相关内容有关。

134

被折叠的 条评论
为什么被折叠?



