流化Excel文件入库问题!
如题,代码如下 string fileName=@"F:\work\test.txt";
byte[] bytes=new byte[fs.Length];
[align=center][align=left]MessageBox.Show(bytes[0].ToString());
fs.Read(bytes,0,Convert.ToInt32(fs.Length));
MySqlCommand cm=new MySqlCommand();
MySqlConnection cn=new MySqlConnection();
cn=client.common.MyConnection.GetConnection();
cm.Connection=cn;
cm.CommandType=CommandType.Text;
if(cn.State==0)
cn.Open();
cm.CommandText="insert into test (a,b,c) values (1,1,@file)";
MySqlParameter spFile=new MySqlParameter("@file",MySqlDbType.LongBlob);
spFile.Value=bytes;
cm.Parameters.Add(spFile);
cm.ExecuteNonQuery();
Mysql数据库,字段类型设置的LongBlob,现在c字段里的数据就是Excel文件流,
程序应该没什么问题了,但是就是读不进Excel的流数据,望高手解答,谢谢!!!急