Hi
I have belwo for all Customers. What will bet the procedure for GetById & how to fecth in Controller
public List
{
List
using (SqlConnection con = new SqlConnection(Common.Con))
{
con.Open();
SqlCommand cmd = new SqlCommand("sp_Customer", con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@Action", "R");
SqlDataReader rdr = cmd.ExecuteReader();
while (rdr.Read())
{
objCustomer.Add(new Customer
{
Id = rdr["Id"].ToString(),
Description = rdr["Description"].ToString(),
IsActive = Convert.ToBoolean(rdr["IsActive"]),
});
}
return objCustomer;
}
}
Thanks
Sachin SinghPosted Jun 18, 2021, 10:37 AM
Salman BegPosted Jun 18, 2021, 9:23 AM
Ramco RamcoPosted Jun 18, 2021, 7:08 AM
{
Salman BegPosted Jun 18, 2021, 6:56 AM