This article explains using Chart.js in Asp.net C# Web Application we can create a pie chart with database MS SQL server connectivity via jQuery ajax call. You can also have a look on related article, . Now in this post here we create a pie chart by using chart.js library and bind data from our database MS Sqlserver, with jQuery ajax calling. Here we are creating a pie chart, which shows data from the database (Ms SQL server). In my database, I have a table which stores data (website traffic…
Author: Enrico
Encrypting QueryStrings with .NET
Once upon a time in the tech world, obscurity was security – this being most true in the early years of the industry, when there were gaping holes in privacy policies and confidential client information was bandied about from site to site without a care as to who actually could read the information. With the new Cryptography classes in .NET, there’s absolutely no excuse for not hiding even the most innocuous user data. If you ever need to ‘piggy-back’ information from one web page to another, whether it is within…
First screenshot of Windows Phone 10
Setting page: now a nice and clear page Outlook Mail: cute and easy to use Cortana: if Cortana understand me, it’ll be better 🙂 Outlook Calendar: ooohhh!
Exception Handling in ASP.NET MVC
Index 1. Introduction 2. HandleErrorAttribute 3. Limitations of HandleError 4. HandleError vs Application_Error 5. Extending HandleError 6. Returning views from Application_Error 7. ELMAH 8. Summary Introduction Exception handling is a serious matter in any application, whether it’s web or desktop. Implementing a proper exception handling is important in any application. In most cases once we catch the exception we have to log the exception details to database or text file and show a friendly message to the user. In ASP.NET applications, error handling is done mostly in two ways: at…
Apple sides with Microsoft in closely watched patent dispute with Google
Lawyers for Microsoft and Google will appear Wednesday morning at the 9th Circuit Court of Appeals in San Francisco in a long-running dispute over patents that were originally owned by cell phone maker Motorola Mobility. But this is no ordinary patent showdown. Other tech companies are watching the case closely for its potential to set a precedent for negotiations over “standard-essential patents” or “SEPs” — technologies required to implement industry standards. The case has already created some unusual alliances. Apple (PDF) and T-Mobile (PDF) are among the companies siding with Microsoft in the case,…
OGData extension for BlogEngine.NET
How improve your posts with OGData extension for BlogEngine.NET, here step by step what you have to do with my simple component
Microsoft announces Windows 10 release set for this summer in 190 countries
Microsoft plans to release Windows 10 this summer in 190 countries and 111 languages, the company announced today, though a specific date was not named. In a blog post on the Windows website, Terry Myerson, head of Microsoft’s operating systems team, didn’t elaborate on the release time frame beyond saying it was shared at the Windows Hardware Engineering Community event in Shenzhen, China, today. The time frame aligns with an earlier Neowin report that the company is planning to finish the operating system in June to ready it for consumer…
PSC.Search: a new implementation of Levenshtein distance algorithm
This article describes a simple implementation of the string search. It can be used for approximate string matching (for more information, see https://en.wikipedia.org/wiki/Fuzzy_string_searching). Other algorithms for approximate string searching exist (e.g., Soundex), but those aren’t as easy to implement. The algorithm in this article is easy to implement, and can be used for tasks where approximate string searching is used in an easy way. The algorithm used the Levenshtein-distance for determining how exact a string from a word list matches the word to be found. Information about the Levenshtein-distance can…
Templates With Razor
Razor is a great way to create views with ASP.NET MVC. One feature I use quite often are custom helpers. Instead of duplicating the same few lines of markup I simply create a reusable helper to generate HTML. For example, you could create a helper to do something simple like render out a series of values… @helper tabs(params Tab[] tabs) {<ul> @foreach(var tab in tabs) { <li><a href=”@tab.Url” >@tab.Text</a></li> }</ul>} Then use the helper by providing the parameters it needs… @tabs( new Tab { Text = “Google.com”, Url = “https://google.com”…
IDC: Android and iOS accounted for 96.3% of global smartphone shipments in Q4 2014 and the whole year
Android and iOS accounted for 96.3 percent of all smartphone shipments in Q4 2014, and coincidentally, 96.3 percent for all of last year as well. That means the duopoly grew 0.6 percentage points compared to the same period last year (95.7 percent in Q4 2013) and 2.5 percentage points on an annual basis (93.8 percent in 2013). iCharts The latest figures come from IDC, which puts together these estimates every quarter. Here is the breakdown for the full year: Above: Volume units are in millions. Google’s mobile operating system…
Introducing ASP.NET 5
The first preview release of ASP.NET 1.0 came out almost 15 years ago. Since then millions of developers have used it to build and run great web applications, and over the years we have added and evolved many, many capabilities to it. I’m excited today to post about a new release of ASP.NET that we are working on that we are calling ASP.NET 5. This new release is one of the most significant architectural updates we’ve done to ASP.NET. As part of this release we are making ASP.NET leaner, more…
SQL Server: how to convert INTEGER to TIME
I have a very simple solution. If you have a field in database in int format and you want to know how many seconds it’s, the query is: SELECT CONVERT(char(5), DATEADD(second, AVG(Avg_time), ‘20150101’), 108) as myAverageFROM T_GoogleAnalytics_dataHAVING (AVG(Avg_time) IS NOT NULL)
What is HTTP/2 and is it going to speed up the web?
The web is about to get faster thanks to a new version of HTTP – the biggest change since 1999 to the protocol that underpins the world wide web as we know it today. Hypertext Transfer Protocol is familiar to most as the https:// at the beginning of a web address. It governs the connections between a user’s browser and the server hosting a website, invented by the father of the web Sir Tim Berners-Lee. What is HTTP/2? HTTP/2 is the next version of HTTP and is based on Google’s…
Implementing Scrum (Agile) and CMMI Together
IntroductionIf you are a software engineer or IT professional, your group has very likely shown a strong interest in reducing costs, improving quality and productivity. Your group might also have looked at various pre-packaged frameworks, such as Agile (e.g., Scrum and Extreme Programming), CMMI1, and Six Sigma. At first glance, each of these frameworks might look at odds with each other, making it difficult to use two or more. This typically occurs because much of the information shared regarding these frameworks is from success and failure stories, rather than understanding…
CoreCLR is now Open Source
We’re excited to announce that CoreCLR is now open source on GitHub. CoreCLR is the .NET execution engine in .NET Core, performing functions such as garbage collection and compilation to machine code. .NET Core is a modular implementation of .NET that can be used as the base stack for a wide variety of scenarios, today scaling from console utilities to web apps in the cloud. To learn how .NET Core differs from the .NET Framework, take a look at the Introducing .NET Core blog post. You can check out the…
Developing a REST Web Service using C# – A walkthrough
REST stands for Representational State Transfer. The term was introduced by Roy Fielding in his doctorial dissertation. REST is an architectural style for designing networked applications. It is an alternate to using complex mechanisms like COBRA, RPC, and SOAP to connect between client and server. REST makes communication between remote computers easy by using the simple HTTP protocol which support for CRUD (Create, Read, Update, and Delete) operations on the server. In a way, our World Wide Web is also based on the REST architecture. In a nutshell, REST is…
C# Extension Method
An extension method has simplified calling syntax. It represents static methods as instance methods. An extension method uses the this-keyword in its parameter list. It must be located in a static class. Example First, here is a custom extension method defined in a program written in the C# language. Generally, you will want to store your extension method class in a separate source file, such as “ExtensionMethods.cs” in your project. Note:This file should store a static class with public static extension methods. Then: In the rest of your source code,…
How create a OFT file for HTML?
OFT file is a Outlook Template of an email. If you need to send a newsletter for example, it’s very useful to create this kind of file. The procedure to make a OFT file is very simple: build html file open the file in Internet Exlorer in IE open the menu (don’t use the icon!) File | Send | Page by e-mail Outlook opens a new email with the page click on File | Save As, click dropdown and select Outlook Template (*.oft), save to desired location
Reading multiple excel sheets with different worksheet names
I would like to know how I can read multiple excel worksheet with different worksheet name in c# and with the used of oledb. I have this existing way to read multiple sheets (but with fixed worksheet name): DataSet ds = new DataSet(); var excelConnectionString = string.Format(“Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};Extended Properties=Excel 8.0”, path); OleDbConnection connection = new OleDbConnection(); connection.ConnectionString = excelConnectionString; var i = 1; while (i <= 4) { string query = “SELECT * FROM [Sheet” + i + “$]”; ds.Clear(); OleDbDataAdapter data = new OleDbDataAdapter(query, connection); data.Fill(ds); …
Download page from web with encoding
Usually you can use WebClient to download a page from web but no always it’s a good way, sometimes the page encode is different. With this code you can download without problems! #region ” Download page “public static string PageDownload(string url){ HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url); using (HttpWebResponse resp = (HttpWebResponse)req.GetResponse()) { byte[] buffer; using (Stream s = resp.GetResponseStream()) { buffer = ReadStream(s); } string pageEncoding = “”; Encoding e = Encoding.UTF8; if (resp.ContentEncoding != “”) pageEncoding = resp.ContentEncoding; else if (resp.CharacterSet != “”) pageEncoding = resp.CharacterSet; else…
What is the JavaScript Equivalent of print_r in PHP?
What is the JavaScript Equivalent of PHP print_r() function? In other words, how you can “print” a javascript object in a way that’s readable by humans? Code You could use JSON.stringify, as following: The HTML part Let’s create two links for demo: <p><a id=”print_demo” href=”javascript:void(0);”>Print object</a></p><p><a id=”pretty_print_demo” href=”javascript:void(0);”>Pretty Print object</a> The JAVASCRIPT part Remark: I use jQuery to handle events, but you can use plain javascript (if you prefer). <script type=”text/javascript”> $(function() { // create an object var person = new Object(); person.firstname = “John”; person.lastname = “Doe”; person.age =…
How to Detect Browser (and browser version) using JavaScript
Browser (and browser version) detection is an “all time classic” development requirement. jQuery.browser WAS an excellent solution, but it was removed in jQuery 1.9. Actually, it would be better to try to detect a browser feature instead of browser name itself, where possible. An ideal solution for this is Modernizr (a JavaScript library that detects HTML5 and CSS3 features in the user’s browser). But, if you still need to detect browser and browser version (using javascript), I suggest the following solutions (among many others): Bowser – A Browser detector and…
Render LocalReport using Microsoft ReportViewer DLL Version 11.0.3366.16
I downloaded the latest Microsoft ReportViewer from the link below and installed it. I want to be able to export (render) my Excel files in xlsx format. I’m referencing version 11.0.3366.16 of the following dll’s in my project… Microsoft.ReportViewer.CommonMicrosoft.ReportViewer.ProcessingObjectModelMicrosoft.ReportViewer.WinForms The download linkhttps://www.microsoft.com/en-us/download/details.aspx?id=35747 When specifying what you want your output to be, instead of sending WORD and EXCEL as the parameters for the output, send WORDOPENXML and EXCELOPENXML for the new office version. To verify what output your version of assemblies support, use <ReportObjec>.LocalReport.ListRenderingExtensions For example:RenderingExtension[] r = reportViewer.LocalReport.ListRenderingExtensions(); The complete…
Mime type for Microsoft Office 2007-2010
.xlsx application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.xltx application/vnd.openxmlformats-officedocument.spreadsheetml.template.potx application/vnd.openxmlformats-officedocument.presentationml.template.ppsx application/vnd.openxmlformats-officedocument.presentationml.slideshow.pptx application/vnd.openxmlformats-officedocument.presentationml.presentation.sldx application/vnd.openxmlformats-officedocument.presentationml.slide.docx application/vnd.openxmlformats-officedocument.wordprocessingml.document.dotx application/vnd.openxmlformats-officedocument.wordprocessingml.template.xlam application/vnd.ms-excel.addin.macroEnabled.12.xlsb application/vnd.ms-excel.sheet.binary.macroEnabled.12
[A]System.Web.WebPages.Razor.Configuration.HostSection cannot be cast to… web.config issue
I have a problem like this on server [A]System.Web.WebPages.Razor.Configuration.HostSection cannot be cast to [B]System.Web.WebPages.Razor.Configuration.HostSection. Type A originates from ‘System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ in the context ‘Default’ at location ‘C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.WebPages.Razor\v4.0_2.0.0.0__31bf3856ad364e35\System.Web.WebPages.Razor.dll’. Type B originates from ‘System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ in the context ‘Default’ at location ‘C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.WebPages.Razor\v4.0_1.0.0.0__31bf3856ad364e35\System.Web.WebPages.Razor.dll’. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.InvalidCastException: [A]System.Web.WebPages.Razor.Configuration.HostSection cannot be cast to [B]System.Web.WebPages.Razor.Configuration.HostSection. Type A originates from ‘System.Web.WebPages.Razor, Version=2.0.0.0,…