protected void imgfun() { using (SqlConnection connection = new SqlConnection(connString)) { foreach (ListItem list in chek.Items) { string sql = string.Empty; sql = "Select icon from imagetb where code_id =" + list.value+ " and icon is not null"; connection.Open(); SqlCommand command = new SqlCommand(sql, connection); SqlDataReader reader = command.ExecuteReader(); if (reader.Read()) { byte[] imgData = (byte[])reader["icon"]; Response.BinaryWrite(imgData); } } } }
byte[] imgData = (byte[])reader["icon"]; File.WriteAllBytes("your apps local folder path", imgData );
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)