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 SinghRank #66 · 26.2K reputationPosted Jun 18, 2021, 6:37 AM EDT
Salman BegRank #284 · 8.8K reputationPosted Jun 18, 2021, 2:56 AM EDT
Ramco RamcoRank #462 · 5.4K reputationPosted Jun 18, 2021, 3:08 AM EDT
{
Salman BegRank #284 · 8.8K reputationPosted Jun 18, 2021, 5:23 AM EDT