its a sample to save image file in a Database,I hope u need this.
Code:
if( FileOpenDlg.ShowDialog() == DialogResult.OK)
{
string file = FileOpenDlg.FileName;
System.IO.FileStream stream = new System.IO.FileStream(file, System.IO.FileMode.Open, System.IO.FileAccess.Read);
byte[] buffer = new byte[stream.Length];
stream.Read(buffer, 0, (int)stream.Length);
stream.Close();
string strName = System.IO.Path.GetFileNameWithoutExtension(file);
//SavePic
DataRow PicRow;
PicRow = dsDabir1.Tables["Images"].NewRow();
PicRow.SetParentRow(IncomeRow);
PicRow["IsScaned"] = 0;
PicRow["ImgPic"] = buffer;
dsDabir1.Tables["Images"].Rows.Add(PicRow);
buffer = null;
}//if
Always:),
Hovik Melkomian.