Eg Net Solution: SqlClient

Here in this sites web and software developer can get some essential information.

MY Favorite .Net Question For Interview

This are not tidy. Just for rough. In Sha Allah will make it tiddy soon. 1.  DateTime2 Date range 0001-01-01 through 9999-12-31  vs Date...

Users Countries


Showing posts with label SqlClient. Show all posts
Showing posts with label SqlClient. Show all posts

Thursday, November 1, 2018

Using SqlClient connect to sql server and CRUD in Databse thorough Stored Procedure

November 01, 2018 0
Using SqlClient  connect to sql server and CRUD in Databse thorough Stored Procedure

  1.   public List<LDNo> LDNoList(Int64? LDNo)
  2.         {

  3.             ResultModel result = new Models.ViewModel.CommonViewModel.ResultModel();
  4.             string error = String.Empty;
  5.             QUERY2 query = new QUERY2();
  6.             Dictionary<string, object> dict = new Dictionary<string, object>();//= new Dictionary<string, string> 
  7.             List<LDNo> ldnoList = new List<LDNo>();

  8.             dict.Add("@LDNO", LDNo);
  9.             dict.Add("@Result", 1.ToString());
  10.             dict.Add("@Message", "Message".ToString());
  11.             query.SQL = @"SPROC_GET_tblDyesForecastingHead_LDNO";
  12.             query.PARAMETER = dict;
  13.             clsDataprocess cls = new clsDataprocess();
  14.             result = cls.ExecuteSqlStoredProcedureSaveEdit(query, "get", out error);
  15.             if (result.Result && result.DtTable != null && result.DtTable.Rows.Count > 0)
  16.             {
  17.                 Int64 tempi = 0;
  18.                 for (int i = 0; i < result.DtTable.Rows.Count; i++)
  19.                 {
  20.                     LDNo lDNo = new LDNo();
  21.                     Int64.TryParse(result.DtTable.Rows[i]["LDNO"].ToString(), out tempi);
  22.                     lDNo.LdNo = tempi;
  23.                     ldnoList.Add(lDNo);

  24.                 }
  25.                 string Message = result.Message;
  26.                 string Result = result.Result.ToString();
  27.             }
  28.             else if (!result.Result)
  29.             {
  30.                 throw new Exception(result.Message);
  31.             }

  32.             return ldnoList;
  33.         }

Wednesday, August 15, 2018

Using SqlClient connect to sql server and CRUD in Databse thorough code base Inner Query Query

August 15, 2018 0
Using SqlClient  connect to sql server and CRUD in Databse thorough code base Inner Query Query
2.  SqlClientCode For Calling StoredProcedure for Getting Data

  1.   public JsonResult BuyerList()
  2.         {
  3.             Chemical_DAL obj_dal = new Chemical_DAL();
  4.             return Json(obj_dal.BuyerList());
  5.         }

2. Service
  1. public class QUERY
  2. {
  3.     public string SQL { get; set; }
  4.     public Dictionary<string, string> PARAMETER { get; set; }
  5.     public Dictionary<string, byte[]> BYTEPARAMETER { get; set; }
  6. }



Add Choice