navidiran
یک شنبه 25 مهر 1389, 12:02 عصر
سلام. شاید سوالم تکراری هست اما نمی تونم راهی پیدا کنم. می خواهم عکس رو در SQL با استفاده از linq ذخیره کنم.
دستوراتی که تونستم بنویسم به این شکل هستند اما جوابی نمی تونم بدست بیارم.
publicstaticstring PictureName = "";
privatevoid PictureBtn_Click(object sender, EventArgs e) {
openFile1.Filter =
"Jpg File|*.Jpg|BitmapFile|*.Bmp|TIFF|*.TIF;*.TIFF|PNG| *.PNG|ICON|*.ICO;*.ICON
if (openFile1.ShowDialog() == DialogResult.OK)
{ pictureBox1.Image =
Image.FromFile(openFile1.FileName);
PictureName = openFile1.FileName;
}
}
MemoryStream ms = newMemoryStream();
pictureBox1.Image.Save(ms, pictureBox1.Image.RawFormat);
byte[] array = ms.GetBuffer();
ms.Close();
per.Picture = ?;
دستوراتی که تونستم بنویسم به این شکل هستند اما جوابی نمی تونم بدست بیارم.
publicstaticstring PictureName = "";
privatevoid PictureBtn_Click(object sender, EventArgs e) {
openFile1.Filter =
"Jpg File|*.Jpg|BitmapFile|*.Bmp|TIFF|*.TIF;*.TIFF|PNG| *.PNG|ICON|*.ICO;*.ICON
if (openFile1.ShowDialog() == DialogResult.OK)
{ pictureBox1.Image =
Image.FromFile(openFile1.FileName);
PictureName = openFile1.FileName;
}
}
MemoryStream ms = newMemoryStream();
pictureBox1.Image.Save(ms, pictureBox1.Image.RawFormat);
byte[] array = ms.GetBuffer();
ms.Close();
per.Picture = ?;