Skip to main content

Posts

Dynamic charts with ASP.NET, Windows chart controls

We all know how important charting is now days. We all store lots of data but the end users generally are the people who do not have much time to use it after putting in hours in correlating and analyzing it. They generally ask for reports charts etc. Traditionally either we had to use GDI+ or buy a third party tool to provide these facilities. MS has started providing this facility free of cost since 2008 (though it was not part of 3.5 framework but one can download the exe and can install it). Starting from framework 4.0 charting controls are also shipping with .NET. It is quite easy to use chart controls, let us see how. Create a web application project and from the toolbox (in design mode) drag chart control. It will be present under the data section. Configure the datasource and set the chart type and X and Y column for the chart. I am using a SQLDataSource and AdventureWorks as my DB. Now we are good to go. Press F5 and you can see the chart. Let us extend the functiona...

HTTP Error 403.14 - Forbidden

You might see the error “HTTP Error 403.14 – Forbidden” when you have a Web site that is hosted on Internet Information Services (IIS) 7.0 and when you visit the Web site in a Web browser. Error Server Error in Application " application name " HTTP Error 403.14 - Forbidden HRESULT: 0x00000000 Description of HRESULT : The Web server is configured to not list the contents of this directory.   Discussion This problem occurs because the Web site does not have the Directory Browsing feature enabled, and the default document is not configured. Now what is this “Default Document”? A default document is the document to which the request will be redirected by the server when the user hits you website domain. That is, the user is typing “http://www.<domain name>” e.g. http://www.anujyadavcse.blogspot.com . Here the user is not typing which page he want the server to serve as part of the request. e.g. http://localhost/Admin.aspx . This generally is the home/login pag...

SQL Server Encryption Using T-SQL functions - Encrypt and Decrypt a Password using EncryptByPassPhrase and DecryptByPassPhrase

Introduction You can use encryption in SQL Server for connections, data, and stored procedures. This Article explains you how to Encrypt and Decrypt a text using T-SQL functions.you can encrypt a password and can store a password as VarBinary in a column by using EncryptByPassPhrase function . Encrypted column can be decrypted by using DECRYPTBYPASSPHRASE function. Encryption Encryption is the process of obfuscating data by the use of a key or password. This can make the data useless without the corresponding decryption key or password. Encryption does not solve access control problems. However, it enhances security by limiting data loss even if access controls are bypassed. For example, if the database host computer is misconfigured and a hacker obtains sensitive data, that stolen information might be useless if it is encrypted. Although encryption is a valuable tool to help ensure security, it should not be considered for all data or connections. When you are de...

SSRS Part 1-Introduction to SQL Server Reporting Services

In this post we will have a look in to SQL Server Reporting Services. In this post we will se its need, capabilities, features and requirements. Before starting on it we will try to analyze the need for it. Why Reporting? Data represented in a usable form provides us information which we need to drive the business in an intelligent way. Enterprises have been collecting data for decades now. It has been a challenge to collect quality data along with quantity. We seems to have overcome this challenge with experience. The challenge which we face now is using this data productively to gain benefit. Data mining is the need of the hour. Here comes the reporting. Workers at all level in organization need information with and for different perspective. Workers at higher level needs reports to get the information to take knowledgeable decisions to benefit the organization and individual. Workers at lower level need information to be productive and perform their task in a more effective mann...

How to create a batch file (BAT)? How to run (execute) batch file?

Generally speaking batch files are text files with .bat extension with group of commands that you can execute on command line (cmd). They are generally used to group multiple tasks for smooth and reliable execution, to automate stuff, for repeated jobs etc. Admins generally use these files for administrating the system and also for deployment. Enough said lets see how we can create one and work with it. You can use your favorite text editor. I am going to use notepad. Type -  echo "hello world" in it and save it with the name (any name) firstbat.bat in 'C' drive . Go to start -> run-> cmd Run/Execute the batch file Change the current directory to 'C', for that type cd c:/ of cmd and press enter . Now type 'firstbat' and press enter and you will see "hello world" on the screen. So in short in cmd you will have to go to the directory where you have store the batch file and then type the name of the batch file. Now, le...

ASP.NET custom forms authentication part 2

Did not receive any comment for Part 1 but going by the stats I think it has been useful for few of you. Thus I think I should Part 2. In this article we are going to  demonstrates how to set up custom forms authentication.  The login page assumes logging in using username and password (as demonstrated in Part 1 ).  The user roles for the site are stored in the database. For user identification I need userID and for authorization I need to know which group does user belong to. Wait a minute, ASP.NET provides way to handle it in web.config. like this:      <location path="Admin">     <system.web>       <authorization>         <allow roles="Admin"/>         <deny users="*"/>       </authorization>     </system.web>   </location>         ...

Date format problem with ASP.NET calendar and IIS

Today I was working on an existing ASP.NET application. The application is using an ASP.NET calendar control. We were creating a new environment for the testing team. The application was working fine but suddenly we realized there is some problem. The problem was with the date format. The expected date format was mm/dd/yyyy but we were getting mm-dd-yyyy (even after formating). I started working on this. First thing I thought was that it has something to do with the environment as the code is fine (as it is working fine on other machines). I googled a bit and found out that it is a common problem. So I thought about blogging about it in hope that it will help others. I found out that the problem is with the "Region and Language". For that go to control panel. You need to change the date format and the region as required. Now you need to restart the system.  Sometimes even after doing that you will not get the desired result. Then go to Administrative tab and...