Tuesday, 16 June 2015

open resx file in xml format

If you are opening the resourse file, it will open it in tabular format, with key, value and descriptions.

Like below screen.If you will edit the resorse file in this format it shows changes in many place even you added one value.

Sunday, 14 June 2015

itextsharp html to pdf


1.  Before starting the code for conversting the HTML to PDF using ITextSharp you need to download the ITextsharp Dll and placed it into the Bin folder. You can get the ItextSharp Dll from below path;


2.  Now you want to generate the PDF, by clicking any of the button in your page, You have to place the below code on your C# file and  there it will pass the HTML content to the Export method where it is using the ItextSharp methods for converting the HTML to PDF..

protected void btnGeneratePDF_Click(object sender, EventArgs e)
        {
            StringWriter sw = new StringWriter();
            HtmlTextWriter hw = new HtmlTextWriter(sw);
            this.Page.RenderControl(hw);
            //   string redirectUrl = HttpContext.Current.Request.Url.AbsoluteUri;
          

Wednesday, 27 May 2015

read xml attribute value c#

Due to get some Values from HTML or for XML there we need to Read XML Attributes Values from given string in C#.

There is the sample code below; which is using System.Xml.Linq.
which will help you to over come this problem. and read the XML attribute value through c#


Suppose you have the XML attributes as below; There we are finding the description from Given attributes.

string str = @"<label description='My Button Text' languagecode='5001' />";

Thursday, 30 April 2015

entity framework insert update delete

As in previous article explained that how we can create the entity frame work classes and how we can use it. 
Refer below link for the same;


Now in This Session will explain you how to perform the insert update delete operation in entity framework.


Suppose you have the table like below

Monday, 27 April 2015

Entity framework in asp.net


Microsoft make our life easier to provide the Entity frame work and release us to use the traditional way to use the database connectivity. It provides an O/RM framework called "Entity Framework" to automate database.

By Entity Framework in Asp.net, developer’s can queries using LINQ, then retrieve, Insert, Update and manipulate data as strongly typed objects. 

Entity Framework can be useful on any type of architecture opted by you either is code first approach or data driven approach.

 In Code first approach either you can have all the code views or by this you want to create the data base.

In Data Driven approach you have database ready and by which you want to create the classes that will interact with the database.

I am going to demonstrate the Data driven approach. It’s really good for beginners for starting the entity framework.

11 Steps to create Entity Framework and work with it.


1.       Suppose you have data base with below given table.

Monday, 20 April 2015

WebMatrix.WebData.dll into project

Including the WebMatrix.WebData.dll into the project.
I was trying it to Nuget Package to get the WebMatrix.WebData.dll but it is not getting. To get that WebMatrix.WebData.Dll into your solution you need to install it from package manager.
Open the package manager by;


Tuesday, 14 April 2015

dbcontext in mvc in not defined (mvc)

I was also facing the same problem DBContext is not Getting for MVC Model and trying in the different approach.

Added the System.Data.Entity.dll from reference but it is not working and getting as;



Tuesday, 7 April 2015

Encryption and decryption password in asp.net c#


Encrypting the password before string to the database, it’s more often that if there is plain string there is chances of hack your system by Hackers.  It will be tough for them to crack it if the password is looking like weird charter symbols.
e.g. If you store the password “test1234” to database and it will store  like; g+yC22ZOR8iB5gdYvhkZcQ==

Sharing you the simple method which is using the MD5 algorithm to encrypt the password and any provided string. MD5CryptoServiceProvider class return the hash as an array of 16 bytes.

Chart control in asp.net

Introducing the Graph/chart control of Microsoft in ASP.Net. Which will help to make your reporting beautiful for Web application Asp.net application.