html
theSqlCommand.Connection = sqlConn; // try { SqlParameter theImageParameter = new SqlParameter("@theImage", SqlDbType.Image); theImageParameter.Value = byteImage; theSqlCommand.Parameters.Add(theImageParameter); // theSqlCommand.Connection.Open(); theSqlCommand.ExecuteNonQuery(); theSqlCommand.Connection.Close(); } catch (Exception e) { theSqlCommand.Connection.Close(); throw new Exception("Error en la base de datos al registrar el logo de la empresa", e); } }
Y listo ... con eso ya se guarda la imagen en la base de datos
revisar
http://social.msdn.microsoft.com/Forums/es-ES/netfxwebes/thread/6eff4ecf-e203-46c5-97d5-b19fe7206aa6 http://social.msdn.microsoft.com/Forums/es-ES/netfxwebes/thread/1f9a0022-b8ea-4e85-87e0-474ed2eacef1 http://social.msdn.microsoft.com/forums/es-es/netfxwebes/thread/B4719C0E-0298-45F3-B8B3-6E99D3922775 http://social.msdn.microsoft.com/Forums/es-MX/vcses/thread/6c8b9ef6-ce6b-4cd5-852f-53ee19ddb83a http://www.eggheadcafe.com/software/aspnet/33454643/-visualizar-imagenes-guardas-en-sql-server.aspx http://ltuttini.blogspot.com/2010/03/aspnet-guardar-imagen-base-de-datos.html http://ltuttini.blogspot.com/2010/03/aspnet-guardar-imagen-base-de-datos.html http://www.todoexpertos.com/categorias/tecnologia-e-internet/desarrollo-de-sitiosweb/asp.net/respuestas/1964571/imagen-en-gridview-desde-sql-server http://www.subgurim.net/Articulos/asp-net-general/95/subir-ficheros-en-asp-net.aspx http://www.es-asp.net/Foro/acceso-y-trabajo-con-datos/395/imagen-gridview.aspx http://www.beansoftware.com/ASP.NET-Tutorials/Images-Database.aspx http://www.subgurim.net/Articulos/ado-net-y-acceso-a-datos/47/gridview-diferentes-columnas.aspx http://robertto6.wordpress.com/2008/04/03/video-para-personalizar-un-gridview-con-imagenes-e-hipervinculos-asp-net2-0-part-08/ http://www.eggheadcafe.com/software/aspnet/33445107/imagen-en-gridview.aspx http://www.solotuweb.com/vc~t~GridView-Examples-for-ASP.NET-2.0:-Displaying-Images-in-a-GridView-Column-enASP.NET~id~6323.html