Jul
5
2013
C#

How to convert from string currency to double in C#

Follow one simple line of C# code to convert from a string currency to double.  var strCurrency = "$103,02.54"; var dOutput = double.Parse(strCurrency, NumberStyles.Currency); dOutput is now holding value: 10302.54 NumberStyles.Currency using have namespace: using System.Globalization;
Apr
13
2013

How to fix Handler “PageHandlerFactory-Integrated” has a bad module “ManagedPipelineHandler” in its module list

I get this error when installing the IIS 7.5 on my Windows 7 64bit system. So after Google around to find the solution, I've figured out that some how the ASP.NET is not installed or is not installed completely because the managed handler is used. However, I had to run the ASP.NET register IIS from the command prompt to fix this problem. Here are the steps on how to solve it: Run CMD (command prompt) as Administrator Type or copy the following commands to the CMD and hit enter: %windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -i %windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -i That's how I solved the issue. Good luck!  
Mar
24
2013

SEO add meta tags dynamically in ASP.NET C#

Here is an example how to add meta tags such as page title, meta description, and meta keywords in asp.net C#.   namespace reference use: using System.Web.UI.HtmlControls; Add the following code into your (.aspx.cs) page: protected void Page_Load(object sender, EventArgs e) { // set page title Page.Title = "Welcome to Phi's Homepage - PhiBui.com"; //Page description HtmlMeta pagedesc = new HtmlMeta(); pagedesc.Name = "Description"; pagedesc.Content ="Phi Bui is Software Engineer & IT Professional in Louisville KY"; Header.Controls.Add(pagedesc); //page... [More]
Mar
24
2013

Simple way to encrypt and decrypt password or data in ASP.NET C#

For the security reasons that you wanted to encypt your password or sensitive data before storing it to the database and decypt after pulling it from the database using ASP.NET C#. Here is two simple method on how to encrypt and decrypt password:   In the code behind (aspx.cs) page, use the following code:   /// <summary> /// To encrypt the input password /// </summary> /// <param name="txtPassword"></param> /// <returns>It returns encrypted code</returns> public string EncryptPassword(string txtPassword) { byte[] passBytes = System.Text.Encoding.Unicode.GetBytes(txtPass... [More]
Mar
24
2013
SEO

Optimize your websites with the lastest SEO Google Cheatshet

This cheatsheet helps you create SEO friendly and increase visibility to the Search engines.       A quick cheatsheet can be download here: Google-one-page-SEO-Guide.pdf (346.75 kb)     Here is the Google Search Engine Optimization Starter Guide for advanced users: search-engine-optimization-starter-guide.pdf (4.12 mb) Good luck and have fun with it!!!
Mar
21
2013
SEO

How To Remove The HTML White Space in ASP.NET C#

Remove the HTML white space at runtime will reduce the HTML page size so the web page will be loading faster. This method is for SEO purposes. Add the code below to any ASPX.CS page or Master page, then browse the page to see the magic.   using System.Text.RegularExpressions; //BEGIN: Removing HTML white Space. ##################################################################### private static readonly Regex REGEX_BETWEEN_TAGS = new Regex(@">\s+<", RegexOptions.Compiled); private static readonly Regex REGEX_LINE_BREAKS = new Regex(@"\n\s+", RegexOptions.Compiled); protected override void Render(HtmlTextWriter writer) { us... [More]
Jan
29
2013

Basic PostgreSQL Shell Commands

Create a database: createdb phidatabase Connect to database: psql phidatabase \l - List databases \d - List tables in database \h - help command \? help on internal lash command \g - execute query \q - quit Basic SQL Queries: CRAETE TABLE phitable (id int, data varchar(200), datecraeted date); INSERT INTO phitable VALUES ('1', 'somevalue', '9-9-2013'); SELECT * FROM phitable; UPDATE phitable SET id=2, data = 'some data' WHERE id = 1; DELETE FROM phitable WHERE = id = 2; DROP TABLE phitable;
Oct
23
2012
ASP.NET // C#

Get html input text values in asp.net C# code behind

Here is how to get html input text values with out having runat="server" from asp.net c# code behind.   Example:   Front-end (.aspx) page: <input type="text" id="text1" name="text1" /> <asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />   Back-end (.aspx.cs) page:  protected void Button1_Click(object sender, EventArgs e) { string getTextValues = Request["text1"].Trim();  }    OR: protected void Button1_Click(object sender, EventArgs e) { string getTextValues = Page.Request.Form["text1"].ToString();  }
Oct
20
2012

How To Reset Auto-Increment in MS SQL Server

After deleting all the entries in the table. The increment will not reset by it self. To reset the auto-Increment to 1, use the SQL Query below: DBCC CHECKIDENT ([Table Name], RESEED, 1)
Sep
11
2012

How to fix MySQL Server Instance Configuration Wizard Not Responding

This problem happened on my windows server 2008 R2 64bit and this is how i solved it: Completely uninstall the MySQL. Delete the MySQL folder in C:\ProgramData. (Note: this folder will be hidden so you can either go to the option menu and show all the hidden files or just type the path into the address bar to access it.) Delete folder MySQL in C:\Program Files\MySQL. Restart your computer/server. Re-install MySQL server and it should works. So what was the problem? Probably, the problem was due to file "C:\ProgramData\MySQL\MySQL Server 5.5\data\ib_logfile0.file". When you uninstall and reinstall the MySQL server, it appends the data to this file, so it will result in larger file ... [More]

Calendar

<<  October 2020  >>
MoTuWeThFrSaSu
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678

View posts in large calendar