Hi all, I want help on saving image to acccess database using asp.net/c#. i can get the inputstream/byte array of the image posted, but now confused about how to write the query to insert this image. Can anyone plz help? Regards
1. Add at the top of class using System.Data.OleDb; 2. Use following code protected void saveimage(Byte _image) { OleDbConnection _conn = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\msaccessname.mdb;"); //replace Images with table name and columnName with column where u want to store image String _cmdstr = "INSERT INTO Images (columnName) VALUES @img"; OleDbCommand _cmd = new OleDbCommand(_cmdstr, _conn); try { _cmd.Parameters.AddWithValue("@img", _image); using (_conn) { _cmd.ExecuteNonQuery(); } } catch(Exception ex) { throw ex; } }