数据库表结构:
drop table content 【程序编程相关:软件工程思想-林锐:第二章 程序员与程】if exists (select name from sysobjects where name = ´content´ and type = ´u´) 【推荐阅读:通过Emit实现动态类生成 】
create table content 【扩展信息:MD5算法研究(转载)】
go( --内容id id bigint identity(1,1) not null, --内容 data image default null, constraint pk_contentid primary key clustered (id))go
const string cnnstr = "provider=sqloledb.1;user id=sa;password=;initial catalog=mydb;data source=(local)";
写入
public bool writecontent(byte [] data)
{ oledbconnection conn = new oledbconnection(cnnstr); string myselectquery = "insert into content(data)values(?)"; oledbcommand mycommand = new oledbcommand(myselectquery, conn); mycommand.commandtimeout = 60; oledbparameter param = new oledbparameter("@data", oledbtype.varbinary, data.length); param.direction = parameterdirection.input; param.value = data; mycommand.parameters.add(param); bool ret = false;... 下一页