Object reference not set to an instance of an object.Object reference not set to an instance of an object.
- appproperty.cs
-
- public DataTable getclientresource(string para_ResourceType ,object MobileNo )
- {
-
- DataTable _getclientresource = maincon.getDataTable("select distinct ClientMaster.ClientName,ClientResources.DisplayName,LinkClientUser.Clientid,LinkClientUser.ClProductId,ClientResources.AccessKey FROM LinkClientUser"
- + " LinkClientUser inner join softplus_clients.ClientMaster ClientMaster on LinkClientUser.clientid = ClientMaster.clientid "
- + " inner join ClientResources ClientResources on ClientResources.ClProductId = LinkClientUser.ClProductId and ClientResources.ResourceType = LinkClientUser.ResourceType and ClientResources.AccessKey = LinkClientUser.AccessKey "
- + " where LinkClientUser.mobileno= '" + MobileNo + "' and LinkClientUser.ResourceType = '" + para_ResourceType + "' ", "dtcomplist");
-
- return _getclientresource;
-
-
- }
- Controller
-
-
- object mobileno;
- appproperty app = new appproperty();
- Profile p;
-
- public ActionResult CompanyList()
- {
-
- mobileno = Session["MobileNo"];
- DataTable dt = new DataTable();
- dt = app.getclientresource("LBROKSYS", mobileno);
- foreach(DataRow dr in dt.Rows)
- {
- p.Displayname = dr["DisplayName"].ToString();
- p.ClProductId = dr["ClProductId"].ToString();
- Session["ClProductId"] = dr["ClProductId"].ToString();
-
- }
- return View();
- }
Ravi SangtaniPosted Jun 16, 2018, 4:34 AM
Guest UserPosted Jun 16, 2018, 1:36 AM
Ravi SangtaniPosted Jun 16, 2018, 1:17 AM