我创建了一个数据表
CREATE TABLE [ProductImages]
(
[ProductImageID] [int] IDENTITY(1,1) NOT NULL,
[ProductImage] [image] NOT NULL
CONSTRAINT [PK_ProductImages] PRIMARY KEY CLUSTERED
(
[ProductImageID] ASC
)
)
Run Code Online (Sandbox Code Playgroud)
我正在尝试用C#编写ProductImages类
public class ProductImages
{
private int productImageID;
public int ProductImageID
{
get { return productImageID; }
set { productImageID = value; }
}
// I need to declare property for ProductImage???
}
Run Code Online (Sandbox Code Playgroud)
我如何为ProductImage声明属性?
Not*_*tMe 19
public byte[] ProductImage { get; set;}
Run Code Online (Sandbox Code Playgroud)
会工作......图像只是二进制文件,你在SQL Server和你的应用程序之间编组它们作为byte []数据类型.
| 归档时间: |
|
| 查看次数: |
29352 次 |
| 最近记录: |