|
how to store .jpg type image in MySQL database?
|
|
|
|
|
Use one of the BLOB types.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
in vb window
Private Sub btnBrowse_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBrowse.Click
Dim OpenFileDialog1 As New OpenFileDialog
With OpenFileDialog1
.CheckFileExists = True
.ShowReadOnly = False
.Filter = "All Files|*.*|Bitmap Files (*)|*.bmp;*.gif;*.jpg"
.FilterIndex = 2
If .ShowDialog = Windows.Forms.DialogResult.OK Then
PhotoPictureBox.Image = Image.FromFile(.FileName)
TextBox1.Text = OpenFileDialog1.FileName.ToString()
End If
End With
End Sub
in C# window
private void btnBrowse_Click(object sender, EventArgs e)
{
if (customeropen.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
txtCustomerPhoto.Text = customeropen.FileName.ToString();
pccustomerphotosample.Image = Image.FromFile(customeropen.FileName);
}
}
|
|
|
|