[Solved] How to sort dictionary by DateTime attribute of the value
try dic.Values.OrderBy(i=>i.CreatedDateTime) 0 solved How to sort dictionary by DateTime attribute of the value
try dic.Values.OrderBy(i=>i.CreatedDateTime) 0 solved How to sort dictionary by DateTime attribute of the value
You should use the following code to make the ASPxGridView show data from this table: if (connection.State == ConnectionState.Closed) { connection.Open(); SqlCommand cmd = new SqlCommand(“Select * From YazHata order by HataAdi ASC”, connection); SqlDataAdapter da = new SqlDataAdapter(cmd); DataTable dt = new DataTable(); da.Fill(dt); ASPxGridView1.DataSource = dt; // <<<< ASPxGridView1.DataBind(); //<<<<< da.Dispose(); connection.Close(); } … Read more
Introduction This article will discuss how to use LINQ to hide a button if all the status values are “Paid”. LINQ is a powerful language-integrated query language that can be used to query and manipulate data in a variety of ways. We will look at how to use LINQ to check if all the status … Read more
You can use the LINQ All method. @if(!Model.PaymentList.All(f=>f.Status==”Paid”)) { <button>click me</button> } Or the Any method @if(Model.PaymentList.All(f=>f.Status!=”Paid”)) { <button>click me</button> } 1 solved Hiding button if all status is “Paid” using LINQ [closed]
it seems that it is returning double. DataTable dt = new DataTable(); double answer = (double)dt.Compute(“(1*4000*700*20)/4000”, “”); Console.Write(answer); 2 solved how to use datatable.compute for division in c#?
Change insQury to string INSQURY = ” insert into [MTS_TV_RO_TC_FINAL] ([DATE],[CAPTION_NAME],[IST],[DURATION],[AMOUNT],[CRID],[JOB_CODE],[AGENCY_CODE],[STATUS],[TBAND_IN],[TBAND_OUT],[DATE_FROM],[DATE_TO],[CREATE_DATE],[USER_NAME],[REMARKS],[Ro_Name],[Job_Name]) SELECT [DATE],[CAPTION],[IST],[DURATION],[AMOUNT],[CRID],'” + TJOBCODE + “‘,[Agency_code],[STAT],[TBAND_IN],[TBAND_OUT],COMP_FROM, COMP_TO,GETDATE() AS DT,'” + Global.uname + “‘ ,[REMARKS],'” + TRo_Name + “‘,'” + TJob_Name + “‘ FROM ” + tmptvrlbktbl + ” ORDER BY DATE”; If COMP_FROM and COMP_TO are dates already you don’t need to surround them … Read more
Don’t use Regex to parse html. A correct way would be using an html parser like HmlAgilityPack var doc = new HtmlAgilityPack.HtmlDocument(); doc.LoadHtml(htmlstring); var links = doc.DocumentNode.SelectNodes(“//a”) .Select(a => a.Attributes[“href”].Value) .ToList(); solved Regular Expression to find out tag and get the value of HREF using C# [duplicate]
when to use ??= operator? From MSDN: The null-coalescing assignment operator ??= assigns the value of its right-hand operand to its left-hand operand only if the left-hand operand evaluates to null. For example, int? a = null; … a ??= 5; //Here a is null, so assign 5 to a int b = a ?? … Read more
Yes you can do that, you have to go to your web.config file and write this. <configuration> <connectionStrings> <add name=”First” connectionString=”…”/> <add name=”Second” connectoinString=”…”/> <add name=”Third” connectionString=”…”/> </connectionStrings> </configuration> You have to change the name of each connection and the connectionString too. 0 solved Connecting with 3 different databases [closed]
I fixed it for you: static void Main() { Class1 c1 = new Class1(); int a=1; c1.test(out a); } When calling a function that has an out or ref parameter, you need to pay some respect to that, by marking your parameter as out or ref as well. MSDN Reference Page To use an out … Read more
You need to use logical operators each time. IF you want to chack all strings to inequality to empty string then use String.IsNullOrEmpty() method instead of != operator. Also there is no reason to use () in your expression. You need to use brackets to prioritize operations but in your code there is no prioritets … Read more
Contains is too slow for large numbers of data, plus it matches the domain and the in-the-middle occurences as well. So use StartsWith System.Data.DataTable dt = //Whatever foreach(System.Data.DataRow dr in dt.Rows) { //string email = dr(“email”); string email = “[email protected]”; if (email != null && email.StartsWith(“companyby”, StringComparison.OrdinalIgnoreCase)) { // do whatever here } } With … Read more
all i need is to check if the two variables are equal to a numeric value, The description of your problem and the description in the code are different. In the code you say you need to check to see if two variables are equal to any value in a particular range, not equal to … Read more
I suggest that you read on how to ask a good question first Straight from Separation of concerns: design principle for separating a computer program into distinct sections, such that each section addresses a separate concern. I hope that you are not the developer taking over this project, because it seems like you have minimal … Read more
Yes, a windows service would be fine. I’d like to use a little library called TopShelve to make a service / console app. Then I’d add NancyFx to expose the service and it’s data (or read it from a shared database). You also asked if there was a ‘better’ way. You might argue that polling … Read more