6
Answers

Image store in Databse and Retrived by using webApi

sameer shaikh

sameer shaikh

8y
198
1
Hi
 
I am new in asp.net webApi and I am trying to make Register api in asp.net webApi, i want to store image at the time of registration process of newUser and retrive image when i called to Get Api in AccountController.
And also performed CRUD operation on image 
 
so please help me How to solved this problem.
 
thanks for reply
Regards 
Sameer 
 
Answers (6)
0
Vikram N
NA 66 14.7k 11y
thank u Sanjeeb...Lemme try it out...:)
0
Sanjeeb Lenka
NA 22.1k 1.3m 11y
check this code:

public int SaveEmp(Emp objEmp)
{
using (SqlConnection con = new SqlConnection("Data Source=.\\SQLEXPRESS;Initial Catalog=Test;Integrated Security=True"))
{
 string query = "Emplyentry";  //stored procedure name
using (SqlCommand cmd = new SqlCommand(query , con))
{
cmd.Parameters.AddWithValue("@EmpName", objEmp.EmpName);
cmd.Parameters.AddWithValue("@EmpSal", objEmp.EmpSal);
con.Open();
int a = cmd.ExecuteNonQuery();
con.Close();
return a;
}

}
}
0
Vikram N
NA 66 14.7k 11y
Thanx a lot for ur kind reply Sanjeeb,That linkhelped me a lot...
But in dat example, database tables are used... But i need stored procedures usage... kindly help:)