如何在水晶报表中动态显示图像
问题描述:
如何在访问数据库中插入图像如何在水晶报表中动态显示图像c#
how to insert image in access database How to show image dynamically in crystal report c#
答
此链接可以帮助您.. :)
示例1 [ ^ ]
示例2 [ ^ ]
示例3 [ ^ ]
Crystal Reports中的图像 [ ^ ]
如何使用Visual Studio 2005在Crystal Reports中动态加载图像 [ ^ ]
this link may help you.. :)
example 1[^]
example 2[^]
example 3[^]
Image in Crystal Reports[^]
How to dynamically load images in Crystal Reports using Visual Studio 2005[^]
private void Submit_Click(object sender, EventArgs e)
{
byte[] picbyte = System.IO.File.ReadAllBytes(textBox.Text);
try
{
string constr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=.\\PIS(ACU).mdb;";
Con = new OleDbConnection(@constr);
Con.Open();
Com = new OleDbCommand();
Com.Connection = Con;
Com.CommandText = "INSERT INTO Pics(Patient_Id,ImageDate,Photo)VALUES(" + txtPatientId.Text + ",'" + txtImageDate.Value.ToString("yyyy/MM/dd HH:mm:ss") + "', @Photo)";
OleDbParameter picParam = Com.Parameters.Add("@Photo", SqlDbType.Binary);
picParam.Value = picbyte.ToArray();
picParam.Size = picbyte.ToArray().Length;
Com.ExecuteNonQuery();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
finally
{
Con.Close();
MessageBox.Show("Image Uploaded Successfully", "PIS System");
DiseaseRecord D = new DiseaseRecord();
D.Show();
this.Close();
}
}
private void btnBrowse_Click(object sender, EventArgs e)
{
OpenFileDialog fd = new OpenFileDialog();
fd.InitialDirectory = "c:\\";
// DialogResult Result = fd.ShowDialog();
if (fd.ShowDialog() == DialogResult.OK)
{
textBox.Text = fd.FileName.ToString();
pictureBox.ImageLocation = textBox.Text;
}
Console.ReadLine();
}