How to display all images from database using web api and angularjs
I'm not getting the images, but getting image icons/symbols something like which is very small. I want all the images to display clearly.
ALTER PROC [dbo].[GETDATA]
AS
BEGIN
SELECT TOP (1000) [AUID]
,[EMPID]
,[CONTENTTYPE]
,[DATA]
FROM [INVOICE].[DBO].[EMPLOYEE_CONTRACT_DETAILS]
END
[HttpGet]
[ActionName("getEmpImages")]
public string getEmpImages()
{
SqlConnection myConnection = new SqlConnection();
myConnection.ConnectionString = ConfigurationManager.ConnectionStrings["ERPConnectionString"].ConnectionString;
SqlCommand sqlCmd = new SqlCommand();
sqlCmd.CommandType = CommandType.StoredProcedure;
sqlCmd.CommandText = "GETDATA";
sqlCmd.Connection = myConnection;
//sqlCmd.Parameters.AddWithValue("@Parameter", Parameter);
SqlDataAdapter sda = new SqlDataAdapter(sqlCmd);
DataSet ds = new DataSet();
string jsonString = string.Empty;
myConnection.Open();
sda.Fill(ds);
myConnection.Close();
jsonString = JsonConvert.SerializeObject(ds.Tables[0]);
return jsonString;
}
$scope.images = null;
$http.get("http://localhost:49556/api/purchaseOrder/getEmpImages")
.then(function (response) {
$scope.images = JSON.parse(response.data);
//$scope.image = $scope.images[0].data;
})
<table class="table table-table-responsive">
<thead>
<tr>
<th>Image</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="image in images">
<td><img ng-src="{{'response:image/jpeg;base64,'+image.data}}" /></td>
</tr>
</tbody>
</table>