c# - Object reference not set to an instance of an object, while sorting table column headers -
I get the following error in the browser I get an error that I have confirmed by commenting this line of code. I am trying to do Edit: GetPropertyValue Method: Ensure your see jTable followed by code and ran away:
Object references are not set for an example of an object. I debug the code and on this line of code
newlist = newlist.OrderBy (item = & gt; GetPropertyValue (item, Sort Expression)). ToList ();
sorting by killing the column header of the table but it is not doing it and gives an error out. Trying to find out on this for a few weeks, but it just does not seem to work. Public JsonResult TopPlayedInVenueList1 (String StartDate = "", String EndDate = "", "" ", int jtStartIndex = 0, int jtPageSize = 0, string jtSorting = null) {try (If Request .IsAuthenticated == true) {string Path = @ "C: \\ 5Newwithdate-1k.xls"; OleDbConnection con = New OleDbConnection (@ "Provider = Microsoft.Jet.OLEDB.4.0; Data Source = '" + Path + " 'Expanded Properties =' + (Four) 34 + "Excel 8.0; IMX = 1;" + (Four) 34 + ""; OleDbDataAdapter da = New OleDbDataAdapter ("Select [from [Sheet 1 $] to", Con) ; Con.Close (); System.Data.DataTable Data = New System.Data.DataTable (); da.Fill (Data); TopPlayed & gt; Daa = New list & topplayed & gt; ; Foreign currency (data. (Top of Play Plade Top = New Top-Play) (TrackID = Convert.ToInt32 (P. Field & lt; Double & gt; ("TrackID"), Date = P. Field & lt; DateTime ("Date Time") ("Times")}; TrackName = p.Field & lt; String & gt; ("TrackName"), ArtistName = P. Field & lt; String & gt; ("Artist name"), times = convert.ToInt32 (p. Field
GetPropertyValue public object (object obj, string propertyName) {obj == empty back? Tap: obj.GetType (). GetProperty (propertyName) .GetValue (obj, null); }
newList element and
Sorting is a proper value.
Comments
Post a Comment