Image Insertion In DB without use of file upload control

Posted by sourabhghosh49-13964 under ASP.NET on 4/3/2012 | Points: 10 | Views : 15242 | Status : [Member] | Replies : 8
how to insert image in database with image control ..??

how to take this image control's url as input stream??

sourabh


Responses

Posted by: Prabhakar on: 4/5/2012 [Member] [MVP] Starter | Points: 25

Up
0
Down
Hi,


go with this article . . it's help us u . .


http://www.codeproject.com/Articles/33310/C-Save-and-Load-Image-from-Database

Best Regard's
Prabhakar

sourabhghosh49-13964, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Prabhakar on: 4/5/2012 [Member] [MVP] Starter | Points: 25

Up
0
Down
Hi,


go with this article . . it's help us u . .


http://www.codeproject.com/Articles/33310/C-Save-and-Load-Image-from-Database

Best Regard's
Prabhakar

sourabhghosh49-13964, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sakthi.Singaravel on: 4/10/2012 [Member] Silver | Points: 25

Up
0
Down
Hi,

See this article, it helps for u...

http://nareshkamuni.blogspot.in/2012/02/insert-image-into-sqlserver-database-by.html

Regards,
Singaravel M

sourabhghosh49-13964, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Hariinakoti on: 4/10/2012 [Member] Starter | Points: 25

Up
0
Down
hi,
see this link

http://www.codeproject.com/Articles/33310/C-Save-and-Load-Image-from-Database

Thanks & Regards
Hari

sourabhghosh49-13964, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sakthi.Singaravel on: 4/10/2012 [Member] Silver | Points: 25

Up
0
Down
Hi hariinakodi,

See the before posts, the same link posted by Prabhakar..

Regards,
Singaravel M

sourabhghosh49-13964, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sakthi.Singaravel on: 4/10/2012 [Member] Silver | Points: 25

Up
0
Down
@ Hariinakodi

try to avoid these type of duplicates..

Regards,
Singaravel M

sourabhghosh49-13964, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: sourabhghosh49-13964 on: 4/11/2012 [Member] Starter | Points: 25

Up
0
Down
Thanks Guys......For helping Me.......

but my question was not that......


Image Insertion In DB without use of file upload control............................

Without use of File Upload Control......

I want To uplaod image from like...image control or from any folder by providing virtual path means any thing else but without use of file upload......

thanks...

sourabh

sourabhghosh49-13964, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Atifsaleem01 on: 8/27/2013 [Member] Starter | Points: 25

Up
0
Down
Hi sourabh,

Try below code to read file bytes and save in database.

try
{
byte[] bytes = System.IO.File.ReadAllBytes(Server.MapPath("FileName"));

Utility ut = new Utility();
SqlConnection con = new SqlConnection(ut.conStr);

SqlCommand command = new SqlCommand("Insert into TableName([Size], [Doc]) Values(@FSize, @FContent)", con);
command.CommandType = CommandType.Text;

command.Parameters.AddWithValue("@FSize", bytes.Length);
command.Parameters.AddWithValue("@FContent", bytes);

con.Open();
command.ExecuteNonQuery();
con.Close();

}
catch (System.Exception exc)
{
Response.Write("Problem occur! " + exc.Message);
}


Regards,

sourabhghosh49-13964, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response