Email Id Address Validation For Asp.Net C# Using Regex Validation

Email Id Address Validation 


Enter Email Id Address in TextBox InValid Id Display Popup Error Message Using Asp.Net C#.

                                Download Coding

                                                Download

                                     DEMO



HTML CODING

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>   
        <asp:TextBox ID="txtEamilId" runat="server" AutoPostBack="True" OnTextChanged="TextBox1_TextChanged"></asp:TextBox>
   
    </div>
    </form>
</body>
</html>


                              C# CODING

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using System.Windows.Forms;
using System.Text.RegularExpressions;

public partial class Battery : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }  
    protected void TextBox1_TextChanged(object sender, EventArgs e)
    {
        Regex regex = new Regex(@"^([\w\.\-]+)@([\w\-]+)((\.(\w){2,3})+)$");
        Match match = regex.Match(txtEamilId.Text);
        if (!match.Success)
        {
            MessageBox.Show("Invalid EmailId", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
        }
        else {

            MessageBox.Show("Valid EmailId", "Valid", MessageBoxButtons.OK, MessageBoxIcon.Information);

        }
    }
}


First Add New Form - Right Click- Solution Explorer - 

Add - Add Reference





Next - Add - Systems.Windows.Form  - OK






Next - Add TextBox From Toolbox - Id Change - AutoPostBack=True






Next - Double Click TextBoxes -  Add NameSpaces - Regex Coding For Email Validation





Next - Run[F5] - Verify Email ID





Between Query in SQL Using in Asp.Net C#

Between Query in SQL

Between SQL Query Using Compare Two Fields Like Two Dates Using in Asp.Net C#.

                                                    DEMO

                                                                                                                                                                                                        


                                           
                                            SQL Query Using C# 


 protected void Button1_Click(object sender, EventArgs e)
    {
        dbcon();
        SqlCommand cmd = new
  SqlCommand("Select report_date as[Dates],name as [Names] from dates where report_date between '"+txtFrom.Text+"' and '"+txtTo.Text+"'",con);
        SqlDataAdapter adp = new SqlDataAdapter(cmd);
        DataTable dt = new DataTable();
        adp.Fill(dt);
        SqlDataReader rd = cmd.ExecuteReader();
        if (rd.Read())
        {
            GridView1.DataSource = dt;
            GridView1.DataBind();
        }
    }


Add Between Sql Command For Compare Two Date Database Table 




Compare Two Dates in Between SQL Query Using DateTimePicker Jquery Calender in Asp.Net C#

Compare Two Dates in Between SQL Query

Compare Two Date Values with SQL Between Command Query Using DataTime Picker  JQuery Calender Control Using in Asp.Net C#.


Jquery Calender View Format,Month,Year 

Jquery Calender With TextBox


Jquery DatePicker with Textbox Using Asp.Net C#
Calender Control DatePicker Using JQuery
Show PopUp Window Open DateTimePicker


                                              DEMO




                            HTML CODING


<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8">
<title>jQuery UI Datepicker - Default functionality</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
     <link rel="stylesheet" href="http://code.jquery.com/ui/1.11.0/themes/smoothness/jquery-ui.css">
    <script src="http://code.jquery.com/jquery-1.10.2.js"></script>
    <script src="http://code.jquery.com/ui/1.11.0/jquery-ui.js"></script>

    <script type="text/javascript" lang="javascript">
        $(function () {
            $("#<%=txtFrom.ClientID %>").datepicker({
                changeMonth: true,
                changeYear: true,
                chandeDate: true
            });         
        });
        $(function () {
            $("#<%=txtTo.ClientID %>").datepicker({
                 changeMonth: true,
                 changeYear: true,
                 chandeDate: true
            });
        });
    </script>
</head>

<body>
<form id="form1" runat="server">
<div> 

    <asp:Label ID="Label1" runat="server" Text="From Date "></asp:Label>
<asp:TextBox ID="txtFrom" runat="server"></asp:TextBox>
    <asp:Label ID="Label2" runat="server" Text="To Date"></asp:Label>
    <asp:TextBox ID="txtTo" runat="server"></asp:TextBox>
    <asp:Button ID="Button1" runat="server" Text="Submit" OnClick="Button1_Click" />
 
</td><td><asp:GridView ID="GridView1" runat="server">
       <AlternatingRowStyle BackColor="#9999FF" />
      <HeaderStyle BackColor="#FF3300" />
            <RowStyle BackColor="Silver" />
    </asp:GridView></td></tr></table></div></form></body></html>


C# CODING

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;
using System.Data.OleDb;
using System.Data;
using System.Data.SqlClient;


public partial class Default4 : System.Web.UI.Page
{
    SqlConnection con;
    public void dbcon()
    {
        string connn = (System.Configuration.ConfigurationManager.ConnectionStrings["dbcon"].ToString());
        con = new SqlConnection(connn);
        con.Open();
    }
    protected void Page_Load(object sender, EventArgs e)
    {
      
    }     
    protected void Button1_Click(object sender, EventArgs e)
    {
        dbcon();
        SqlCommand cmd = new
  SqlCommand("Select report_date as[Dates],name as [Names] from dates where report_date between '"+txtFrom.Text+"' and '"+txtTo.Text+"'",con);
        SqlDataAdapter adp = new SqlDataAdapter(cmd);
        DataTable dt = new DataTable();
        adp.Fill(dt);
        SqlDataReader rd = cmd.ExecuteReader();
        if (rd.Read())
        {
            GridView1.DataSource = dt;
            GridView1.DataBind();
        }
    }
}


First  - Add New WebForm - Add GridView - Textbox For Input Date From ToolBox





Next - Add JQuery DateTimePicker For Two TextBoxes





Next - Add Between Sql Command For Compare Two Date Database Table 






Next - Run[F5]  - Compare Two Dates  - Show Result








What is TCL or Transaction Control Command in SQL Server


Transaction Control (TCL)

TCL Statements are used to Manage the changes Made by DML Statements.  
 It allows statements to be Grouped Together into Logical Transactions.

Examples:

COMMITSaves  After  Finished
ROLLBACKRestore Database to Original Since the Last COMMIT

SAVEPOINTIdentify a Point in a Transaction
SET TRANSACTIONChange Transaction Like Isolation level.


What is DCL or Data Control Language Command in SQL Server

Data Control Language (DCL):

Data Control Language(DCL) is used to control privilege in Database.


Examples:



GRANT Permission to User's Access Privileges to Database
REVOKEAccess Privileges Given with the GRANT command



What in DDL or Data Definition Language Command in SQL Server

Data Definition Language (DDL):

DDL Statements are used to Define the Database Structure or Schema. 

Examples:

CREATECreate Objects in the Database
ALTERAlter Command Structure of  the Database
COMMENTAdd Comments to the Data Dictionary
RENAMERename an Object
DROPDelete Objects from the Database
TRUNCATERemove all Records from a Table






What is DML or Data Manipulation Language Command in SQL Server

Data Manipulation Language (DML):

DML Statements are used for Managing Data within Schema Objects. 

Exmples:

INSERTInsert Data into a Table Fields
UPDATEUpdates Existing Data within a Table Fields
SELECTRetrieve Data from the Database
MERGEMerge Two Field Values (Inert or Update)
CALLCall a PL/SQL Program(Procedural Language for Embedded SQL to PL/SQL) 
EXPLAINAccess Path to Data 
LOCK TABLEControl Table
DELETEDeletes All Records from a Table Using Conditions.