谁能帮我把这些sql语句转换为OleDb,在线等,很急!谢谢
public int StoreImg(string file)
{
FileStream fs=new FileStream(file,FileMode.Open);
BinaryReader br=new BinaryReader(fs);
imagedata=br.ReadBytes(Convert.ToInt32(fs.Length));
OleDbConnection conn=new OleDbConnection("Provider=SQLOLEDB;Data Source=ms-p4;Initial Catalog=sub platform;user id=coins.net;password=coins.net");
conn.Open();
OleDbCommand com=new OleDbCommand();
com.CommandText="insert into image values(@imagedata)";
com.Connection=conn;
com.Parameters.Add("@imagedata",OleDbType.VarBinary);
com.Parameters["@imagedata"].Value=imagedata;
com.ExecuteNonQuery();
com.CommandText=null;
br.Close();
conn.Close();
fs.Close();
return imagedata.GetLength(0);
}