Tuesday, 16 June 2015
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.
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' />";
Labels:
C#
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
Tuesday, 14 April 2015
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.
Subscribe to:
Posts (Atom)





