[c#]代码库
public static string ImgUpdata(string TableName, Byte[] FileByteArray, string FILENAME, string FileID)
{
string Sql = "Update " + TableName + " set IMGFILE=@UpFile ,FILENAME=@FILENAME where FileID='" + FileID + "'";
SqlConnection myCn = new SqlConnection(ConnectionString);
SqlCommand myCmd = new SqlCommand(Sql, myCn);
myCmd.Parameters.Add("@UpFile", SqlDbType.Image, FileByteArray.Length);
myCmd.Parameters.Add("@FILENAME", SqlDbType.VarChar);
myCmd.Parameters["@FILENAME"].Value = FILENAME;
myCmd.Parameters["@UpFile"].Value = FileByteArray;
myCn.Open();
myCmd.ExecuteNonQuery();
myCn.Close();
return FileID;
}
初级程序员
by: 云代码会员 发表于:2015-06-19 15:31:43 顶(0) | 踩(0) 回复
不错
回复评论