| | |
PictureBox/Image - Stored to SQL Database
![]() |
•
•
Join Date: May 2009
Posts: 5
Reputation:
Solved Threads: 0
Hi Fauzan
The short answer is "you can't" as SQL only handles text, not images.
You can however create a table in SQL where you put the links to all the image files. Then in your report you can link the data that you want with that text link. You then take that text output from SQL, and through the formatting of your report you can use that retrieved link to load the picture.
The short answer is "you can't" as SQL only handles text, not images.
You can however create a table in SQL where you put the links to all the image files. Then in your report you can link the data that you want with that text link. You then take that text output from SQL, and through the formatting of your report you can use that retrieved link to load the picture.
Last edited by m_coombes; Jul 23rd, 2009 at 11:51 pm. Reason: poor grammar on my part
Try following links. u will get some idea of storing images in a SQL Server table.
http://www.codersource.net/csharp_re..._database.aspx
http://www.c-sharpcorner.com/UploadF...f-5addf5b77ca4
http://www.codersource.net/csharp_re..._database.aspx
http://www.c-sharpcorner.com/UploadF...f-5addf5b77ca4
Regards
Shaik Akthar
Shaik Akthar
•
•
Join Date: Mar 2009
Posts: 809
Reputation:
Solved Threads: 147
•
•
•
•
Hi Fauzan
The short answer is "you can't" as SQL only handles text, not images.
You can however create a table in SQL where you put the links to all the image files. Then in your report you can link the data that you want with that text link. You then take that text output from SQL, and through the formatting of your report you can use that retrieved link to load the picture.
OP. Use the Data Form Wizard, which you will find under Add-Ins>Add-In Manager and use the ODBC option which means before you use it you will have to create an ODBC DSN. Use each form option in combination with code/class/control and save project for future use. Then once you are ready to go to a DNS Less connection see http://www.connectionstrings.com
Good Luck
Last edited by vb5prgrmr; Jul 24th, 2009 at 10:36 am.
If anyone has helped you solve your problem, please mark your thread as solved.
Thanks
Thanks
•
•
Join Date: Oct 2009
Posts: 2
Reputation:
Solved Threads: 0
hi friend you can easily save an photo and image to the database. check out this code
private void button1_Click(object sender, EventArgs e)
{
OpenFileDialog dlg = new OpenFileDialog();
dlg.Title = "Open Photo";
if (dlg.ShowDialog() == DialogResult.OK)
{
try
{
pictureBox1.Image = new Bitmap(dlg.OpenFile());
name = dlg.FileName;
txtname.Text = dlg.SafeFileName;
}
catch (Exception ex)
{
MessageBox.Show("Unable to load file: " + ex.Message);
}
}
dlg.Dispose();
}
private void button1_Click(object sender, EventArgs e)
{
OpenFileDialog dlg = new OpenFileDialog();
dlg.Title = "Open Photo";
if (dlg.ShowDialog() == DialogResult.OK)
{
try
{
pictureBox1.Image = new Bitmap(dlg.OpenFile());
name = dlg.FileName;
txtname.Text = dlg.SafeFileName;
}
catch (Exception ex)
{
MessageBox.Show("Unable to load file: " + ex.Message);
}
}
dlg.Dispose();
}
![]() |
Similar Threads
- Saving Drawing on PictureBox to SQL Database (VB.NET)
- retrieve image from access db to picturebox (C#)
- Displaying a remote image from url stored in my db (ColdFusion)
- Insert into sql database (ASP.NET)
- SQL Server, Images and DataGrid in ASP.NET (ASP.NET)
- Help with Roles Stored in SQL database (ASP.NET)
- I need an exampls program in java to store image datatype in ms-sql (MS SQL)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: help me out with this
- Next Thread: sapi 5.1 and vb6 help
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age application basic beginner birth bmp calculator cd cells.find click client code college component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report save search sendbyte sites sort sql sql2008 sqlserver subroutine tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





