Posts

String vs String Builder Console Program to Understand :Ref Learning never Ends

 using System; using System.Collections.Generic; using System.Linq; //used for SystemBuilder using System.Text; using System.Threading.Tasks; // Diagnostics used for StopWatch using System.Diagnostics; namespace StringBuilder1 {     internal class Program     {         static void Main(string[] args)         {             string s1 = "Naeem";             Stopwatch sw1 = Stopwatch.StartNew();             sw1.Start();             for (int i = 0; i < 100; i++)             {                 s1 = s1 + i;                 s1 = s1 + "new";                 Console.WriteLine(s1);             }             sw1.Stop();             Console.WriteLine("Time taken by String:" + sw1.ElapsedMilliseconds);             StringBuilder sb = new StringBuilder("Naeem");             Stopwatch sw2 = Stopwatch.StartNew();                sw2 = Stopwatch.StartNew();             for (int i = 0; i < 100; i++)             {                 sb.Append(i);                 sb.

RegistrationFormAdvance.aspx( HTML Designer Page)

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="RegistrationFormAdvance.aspx.cs" Inherits="UserRegistrationForm.RegistrationFormAdvance" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server">     <title>USER REGISTRATION</title>     <style type="text/css">         .danger{             border:red solid 1px;         }         .auto-style5 {             text-align: left;             font-size: x-large;         }         .auto-style6 {             height: 299px;             width: 1240px;             margin-right: 143px;         }         .auto-style9 {             font-size: large;         }         .auto-style16 {             width: 168px;             height: 26px;         }         .auto-style17 {             height: 19px;         }         .auto-style20 {             width: 1118px;             height: 26px;         }         .auto-style

UserRegistrationForm.cs Page code

 UserRegistrationForm.cs  Page code using System; using System.Collections.Generic; using System.Configuration; using System.Data; using System.Data.SqlClient; using System.Linq; using System.Web; using System.Web.Mvc; using System.Web.Services; using System.Web.UI; using System.Web.UI.WebControls; namespace UserRegistrationForm {     public partial class RegistrationFormAdvance : System.Web.UI.Page     {         static string connectionString = ConfigurationManager.ConnectionStrings["connectionString"].ConnectionString;         string Gender;         protected void Page_Load(object sender, EventArgs e)         {             btnSubmit.Attributes.Add("onclick", "javascript:return validationCheck()");             if (!IsPostBack)             {                 ShowData();             }             //ShowData();         }         protected void btnReset_Click(object sender, EventArgs e)         {             txtUserName.Text = "";             txtPass