如何实现word文件上传到Sql Server数据库,库中字段为text型?急救!!!在线等! text type can not implement your requirement.image type will be ok.seehttp://mail.ustc.edu.cn/~jtwu/jtwu/programs.htm 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 说的是数据库已经订了,那个字段必须是文本类型,至于image类型我知道怎么作,还有谁能帮帮我? 用下列代码可以实现txt文件的正常入库,但是doc文件会出现乱码,谁能告诉我咱回事?!SqlConnection con=new SqlConnection(strConn2);string filename=UP_File.PostedFile.FileName;StreamReader sr=new StreamReader(filePath,Encoding.Default,true);String doc=sr.ReadToEnd();sr.Close();SqlCommand command=new SqlCommand();command.CommandType=CommandType.Text;command.Connection=con;command.CommandText="Update cx_jjsqb Set sqwj=@sqwj where bh=@maxbh";SqlParameter parambh=new SqlParameter("@maxbh",SqlDbType.Char,10);parambh.Value=maxbh;command.Parameters.Add(parambh);SqlParameter paramsqwj=new SqlParameter("@sqwj",SqlDbType.Text);paramsqwj.Value=doc;command.Parameters.Add(paramsqwj);con.Open();int RowsAffected=command.ExecuteNonQuery();con.Close(); 怎么在c#.net里进行web安装部署 互联星空接口 和 各 银行的接口 怎么得到,想写个网上商店,付费。 DataGrid插入时候发现个奇怪的现象 为什么设计模式是提倡优先使用组合而不是继承???????? 这个简单的regular exp咋写? 页面中放个media player,怎么设置它的播放列表? 自定义控件 设计界面 一个关于DataGrid和DataView的问题,很棘手!! 有哪位xdjm用C#做图象处理的?盼能相互交流。 小白在线求答案 如何调用其它窗体的事件代码 有没有类似openFileDialog的打开目录对话框?
SqlConnection con=new SqlConnection(strConn2);
string filename=UP_File.PostedFile.FileName;
StreamReader sr=new StreamReader(filePath,Encoding.Default,true);
String doc=sr.ReadToEnd();
sr.Close();
SqlCommand command=new SqlCommand();
command.CommandType=CommandType.Text;
command.Connection=con;
command.CommandText="Update cx_jjsqb Set sqwj=@sqwj where bh=@maxbh";
SqlParameter parambh=new SqlParameter("@maxbh",SqlDbType.Char,10);
parambh.Value=maxbh;
command.Parameters.Add(parambh);
SqlParameter paramsqwj=new SqlParameter("@sqwj",SqlDbType.Text);
paramsqwj.Value=doc;
command.Parameters.Add(paramsqwj);
con.Open();
int RowsAffected=command.ExecuteNonQuery();
con.Close();