public static byte[] imgBytesIn;//用来存储图片的二进制
Stream ms;
byte[] picbyte;
//在创建数据库链接,测试链接成功后,在高级里可自动生成链接数据库字符串,copy出来即可
string str = "Data Source=PC-20180AIHL;Initial Catalog=Image;User ID=sa";
OpenFileDialog openF = new OpenFileDialog();
//获取用户打开的路径然转换成二进制存入数据库
OpenFileDialog ofd = new OpenFileDialog();
ofd.Filter = "*jpg|*.JPG|*.GIF|*.GIF|*.BMP|*.BMP";
if (ofd.ShowDialog() == DialogResult.OK)
{
string filePath = ofd.FileName;//图片路径
FileStream fs = new FileStream(filePath, FileMode.Open);
byte[] imageBytes = new byte[fs.Length];
BinaryReader br = new BinaryReader(fs);
i