.NET Tutorials, Forums, Interview Questions And Answers
 
Welcome :Guest
 
Sign In
Register
 
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Sandeep Singh
Mayuri
stevemarkayden
kumarfurima
Preethi
 
Do you save images in Database?
Poll Started :July 05, 2009  Poll Ends :August 05, 2009   Total Votes : 82
OptionsTotal VotesVote %Trend
Yes, Always1821.95
No, Never1417.07
It depend on client requirment4150
Sometimes910.98
 
Comments
Author: PankajGupta         Company URL: http://www.dotnetspark.com
Posted Date: July 11, 2009    

How we can save Images in database?
Author: Amit Mehra         Company URL: http://www.dotnetspark.com
Posted Date: July 12, 2009    

yes you can save image into database if you are using SQL server than you have to use Image type of column and if you are using Oracle DB than you have to use Blog Data type to save image into database.

Let me know if you need code to save image into database.
Author: Rama Krishna         Company URL: http://www.dotnetspark.com
Posted Date: July 18, 2009    

plese tell me the procedure to save the image in the database
Author: Pankaj Mishra         Company URL: http://www.dotnetspark.com
Posted Date: July 19, 2009    

Hello Rama Krishna,

To save and retrieve Image into/from SQL Server please follow these articles


To Save Image
http://www.dotnetspark.com/kb/35-read--write-image-into-sql-server-asp-net.aspx

To retrieve Image from Sql Server
http://www.dotnetspark.com/kb/36-read--write-image-into-sql-server-asp-net.aspx

Cheers
Pankaj
Author: eromprakash         Company URL: http://www.dotnetspark.com
Posted Date: August 01, 2009    

i have a gridview there are three field like,ID,image,Name and also a link print in gridview . retrieve all record from database showing in Gridview i have done it.but when i click link buttion print in gridview then show all record:

HTML Code:

<tr bgcolor="#f2f2f2" class="black">
<td height="25" style="width: 15px"> </td>
<td ><div align="left">ID*: </div></td>
<td style="text-align: left" id="ct" runat="server" ></td>
<td> </td>
</tr>

<tr bgcolor="#f2f2f2" class="black">
<td height="25" style="width: 15px"> </td>
<td ><div align="left">name : </div></td>
<td style="text-align: left" id="fname" runat="server" ></td>
<td> </td>
</tr>
<asp:Image ID="Image1" Width="120" Height="120" runat="server" ImageAlign ="Middle" />


Csharp Code:

protected void Page_Load(object sender, EventArgs e)
{
conn = new SqlConnection("data source=(local);uid=sa;pwd=sa;initial catalog=databasename");


cmd = new SqlCommand("select name,ID,impimg from tablename where ID='" + Request.QueryString.Get("id") + "'");

cmd.Connection = conn;
conn.Open();
dr = cmd.ExecuteReader();
while (dr.Read())
{
fname.InnerHtml = dr["name"].ToString();

ct.InnerHtml = dr["ID"].ToString();
Image1.ImageUrl = dr["impimg"].ToString();


}


two record dislaying but Image not display .
i want show one by one record when click print buttion please help me.

}
Author: prakashrishu         Company URL: http://www.dotnetspark.com
Posted Date: April 14, 2010    

we can save images in database in 2 ways ist is in the form of byte formate
and second and easier way is store the path of the image in the data base........
 
 
Post Reply 
You must Sign InTo post comment  
 
 
 

See Previous Polls

Which one of the following attacks we often find in Web applications?
Are you using cookies in your asp.net website/application?
Which is the .NET technology you like most to develop ASP.NET applications?
Which new technologies you like more?
Have you started using Visual Studio 2010?
Which Security Tecnique do you implement to secure your Asp.Net application?
Which control do you prefer to display data in Asp.Net Application?
Do you use Cookies in your Asp.Net Application?
Which Database are you using mostly to develop your .NET Application?
Have you started LINQ in your project?
 

Hall of Fame   Twitter    Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend