Thursday, 13 June 2013

Insert,Update,Delete with in GridView in WebForm

Database:

tbl_Gallery










tb_gallery_insert
CREATE PROCEDURE [dbo].[tb_gallery_insert]
       @album_name varchar(50),
       @caption varchar(50),
     @image varchar(50)
AS
      insert into tb_gallery values(@album_name,@caption,@image)
      RETURN
tb_gallery_update
CREATE PROCEDURE [dbo].[tb_gallery_update]
      @id int,
      @album_name varchar(50),
      @caption varchar(50)
AS
      update tb_gallery set album_name=@album_name, caption=@caption where id=@id
      RETURN

tb_gallery_delete
CREATE PROCEDURE [dbo].[tb_gallery_delete]
      @id int
AS
      delete from tb_gallery where id=@id
      RETURN

.Aspx 
<table class="style1" align="center">
<tr>
<td class="style2">
Album Name</td>
<td>
<asp:TextBox ID="txt_album_name" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
ControlToValidate="txt_album_name" ErrorMessage="Please enter the album name"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td class="style2">
Caption</td>
<td>
<asp:TextBox ID="txt_caption" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
ControlToValidate="txt_caption" ErrorMessage="Please enter the caption"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td class="style2">
Image</td>
<td>
<asp:FileUpload ID="FileUpload1" runat="server" />
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server"
ControlToValidate="FileUpload1" ErrorMessage="Please browse the image"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td class="style3">
</td>
<td class="style4">
<asp:Button ID="btn_insert" runat="server" onclick="btn_insert_Click"
Text="Insert" />
&nbsp;
<asp:Button ID="btnfind" runat="server" onclick="Button1_Click" Text="Find" />
&nbsp;<asp:Label ID="lblMsg" runat="server" Text="lblmes"></asp:Label>
</td>
</tr>
<tr>
<td class="style2" colspan="2">
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
onrowcancelingedit="GridView1_RowCancelingEdit"
onrowdeleting="GridView1_RowDeleting" onrowediting="GridView1_RowEditing"
onrowupdating="GridView1_RowUpdating"
onselectedindexchanging="GridView1_SelectedIndexChanging" CellPadding="4"
ForeColor="#333333" GridLines="None">
<AlternatingRowStyle BackColor="White" />
<Columns>
<%--here i am using templatefields to for binding the gridview--%>
<asp:TemplateField HeaderText="Album_name">
<EditItemTemplate>
                          
<%--here i am using the textbox in the edit Itmtemplatefield to upadate the data--%>
    <asp:TextBox ID="txt_album_name" runat="server"
        Text='<%# Eval("album_name") %>'></asp:TextBox>
    <asp:Label ID="Label4" runat="server" Text='<%# Eval("id") %>' Visible="False"></asp:Label>
</EditItemTemplate>
<ItemTemplate>
    <asp:Label ID="Label1" runat="server" Text='<%# Eval("album_name") %>'></asp:Label>
    <asp:Label ID="Label2" runat="server" Text='<%# Eval("id") %>' Visible="False"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Caption">
<EditItemTemplate>
    <asp:TextBox ID="txt_caption" runat="server" Text='<%# Eval("caption") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
    <asp:Label ID="Label3" runat="server" Text='<%# Eval("caption") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Image">
<ItemTemplate>
<%--for displaying the image inside the gidview here i'm using the <img>tag
and specify the path of the folder where image is stored--%>
<img alt ="" src ='images/<%#Eval("image") %>' height="50px" width="50px"/>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Delete">
<%--here i am using the linkbutton to delete the record and specify the command name
of this linkbutton is delete--%>
<ItemTemplate>
    <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False"
        CommandName="Delete"
        onclientclick="return confirm('are you sure you want to delet this column')">Delete</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Update">
<EditItemTemplate>
<%-- here i am using the s linkbuttons to update the record and a  cancel button
and set the commandname of update button is update and the cancel button is cancel --%>
    <asp:LinkButton ID="LinkButton3" runat="server" CausesValidation="False"
        CommandName="Update">Update</asp:LinkButton>
    <asp:LinkButton ID="LinkButton4" runat="server" CausesValidation="False"
        CommandName="Cancel">Cancel</asp:LinkButton>
</EditItemTemplate>
<ItemTemplate>
    <%--here i am using the linkbutton for edit and specify the command name
of this linkbutton is Edit--%>
    <asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False"
        CommandName="Edit">Edit</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<EditRowStyle BackColor="#7C6F57" />
<FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />
<RowStyle BackColor="#E3EAEB" />
<SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" />
<SortedAscendingCellStyle BackColor="#F8FAFA" />
<SortedAscendingHeaderStyle BackColor="#246B61" />
<SortedDescendingCellStyle BackColor="#D4DFE1" />
<SortedDescendingHeaderStyle BackColor="#15524A" />
</asp:GridView>
</td>
</tr>
</table>

.CS file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Xml.Linq;


namespace Asp.net_Sample
{
public partial class CRUD : System.Web.UI.Page
{
// here i declare some variables that will be used below inside the code.
String fn;
String path;
String File;
//String GetFileName;
SqlConnection cnn = new SqlConnection();
SqlCommand cmd = new SqlCommand();
SqlDataAdapter adp;
DataTable dt;
Int32 id;   // id as a integer variable it will be used to catch the id at the time of
//the deletion and updation inside the gridview.
// below  the two string variables will be used to update the record , inside the gridview
String album_name;
String caption;
// the image this string type variable will be used to delete the image from the folder where
//the image will be stored after the record insertion.
String image;

protected void Page_Load(object sender, EventArgs e)
{
//here i declare the connection of the connection string to attach the database with the application
cnn.ConnectionString = ConfigurationManager.ConnectionStrings["jayaConnectionString"].ConnectionString;
cnn.Open();
// if the connection will be closed the below code the connection when the page will be loaded.
if (cnn.State == ConnectionState.Closed)
{
cnn.Open();
}
cnn.Close();

if (IsPostBack == false)
{
// here i am calling the function that will bind the gridview
grd_bind();
}


}

protected void btn_insert_Click(object sender, EventArgs e)
{
// inside the first if condition i am declaring the code for the uploading the image.
if (FileUpload1.PostedFile.ContentLength > 0)
{
fn = FileUpload1.FileName;
path = Server.MapPath("Images") + "/" + fn;
FileUpload1.SaveAs(path);
}
if (cnn.State == ConnectionState.Closed)
{
cnn.Open();
}
// here i am using the store procedure named tb_gallery_insert to insert the record inside the database.
SqlCommand cmd = new SqlCommand("tb_gallery_insert", cnn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Connection = cnn;
// here i am passing the parameters to insert the record
cmd.Parameters.AddWithValue("@album_name", txt_album_name.Text);
cmd.Parameters.AddWithValue("@caption", txt_caption.Text);
cmd.Parameters.AddWithValue("@image", fn);
int i=cmd.ExecuteNonQuery();
if (i > 0)
{
lblMsg.Text = "successfully Inserted";
}
else
{
lblMsg.Text = "Not Inserted";
}
cmd.Dispose();
grd_bind();
cnn.Close();
//here i am calling the function that  will be used after the insertion of the record
//insert the record inside the database.
clr();
}
private void clr()
{
txt_album_name.Text = "";
txt_caption.Text = "";
}
//this function will used to bind the gridview
private void grd_bind()
{
if (cnn.State == ConnectionState.Closed)
{ cnn.Open(); }
// here i am using the sql query to select the record from the database and
adp = new SqlDataAdapter("SELECT * FROM tb_gallery ", cnn);
// here i declare the datatable to fill the record
dt = new DataTable();
// here  i am filling the sqldata Adapter withe the datatable dt
adp.Fill(dt);
// here i am disposing the apd after filling the record
adp.Dispose();
// here i am binding the gridview with the datatable dt
GridView1.DataSource = dt;
GridView1.DataBind();
}

protected void GridView1_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)
{
GridView1.EditIndex = -1;
grd_bind();
}
protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
{
GridView1.EditIndex = e.NewEditIndex;
grd_bind();
}
protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
if (cnn.State == ConnectionState.Closed)
{
cnn.Open();
}

//inside the id variable i am finding the label from the gridview and with the help of this
//label i will fetch the id of the record that i want to update
id = Convert.ToInt32(((Label)(GridView1.Rows[e.RowIndex].FindControl("label4"))).Text);
//inside the album_name variable i am finding the textbox from the gridview and with the help of this
//textbox i will find the album name that the user want to update
album_name = (((TextBox)(GridView1.Rows[e.RowIndex].FindControl("txt_album_name"))).Text);
//inside the caption  variable i am finding the textbox from the gridview and with the help of this
//textbox i will find caption that the user want to update
caption = (((TextBox)(GridView1.Rows[e.RowIndex].FindControl("txt_caption"))).Text);
// here i am using the tb_gallery_update to update the record from the database inside the gridview
SqlCommand cmd = new SqlCommand("tb_gallery_update", cnn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Connection = cnn;
// here i am passing the three variables that will be used to update the record by the stored Procedure
cmd.Parameters.Add("@id", SqlDbType.Int).Value = id;
cmd.Parameters.Add("@album_name", SqlDbType.VarChar, 50).Value = album_name;
cmd.Parameters.Add("@caption", SqlDbType.VarChar, 50).Value = caption;
cmd.ExecuteNonQuery();
cmd.Dispose();
GridView1.EditIndex = -1;
// here i am also calling the function taht will bind the gridview after fetching the record
//from the database
grd_bind();

}

protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
try
{
if (cnn.State == ConnectionState.Closed)
{
    cnn.Open();
}
//inside the id variable i am finding the label from the gridview and with the help of this
//label i will fetch the id of the record that i want to delete
id = Convert.ToInt32(((Label)(GridView1.Rows[e.RowIndex].FindControl("label2"))).Text);
// here i am using the tb_gallery_delete store procedure ti delete the record from the database
SqlCommand cmd = new SqlCommand("tb_gallery_delete", cnn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Connection = cnn;
cmd.Parameters.Add("@id", SqlDbType.Int).Value = id;
// this code will be used to delete the image from the folder too
// here i am using the sql query to select the record that will be selected by the user for deletion
SqlDataAdapter adp = new SqlDataAdapter("select * from tb_gallery where id=@id", cnn);
// here i am passing the parameter that will be used by the above sql query named as id
adp.SelectCommand.Parameters.Add("@id", SqlDbType.Int).Value = id;
DataSet ds = new DataSet();
// here i am filling the sqldataadapter with the dataset dt
adp.Fill(ds);
try
{
    // here i am using the try catch exception becoz if the image will be not available
    // in side the folder. it does not creates the error.
    // inside the image variable i am fetching the image path from the database
    image = Convert.ToString(ds.Tables[0].Rows[0]["image"]);
    // this line will used to delete the image from the folder
    // here i am also giving the folder name where you image was stored.
    File=Server.MapPath("Images") + "\\" + image;
}
catch { }
cmd.ExecuteNonQuery();
cmd.Dispose();
grd_bind();
}
catch
{
}}
protected void GridView1_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
{
GridView1.PageIndex = e.NewSelectedIndex;
grd_bind();
}}}

Output



Monday, 27 May 2013

CheckBoxList Checked Showing Selected items in Asp.net and C#


Now In this Article explain How to Get selected Items from the CheckBoxList in comma-separated format and Javascript Validations in  CheckBoxList .This is common Requirement while working  on asp.net application


aspx code


<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Checkbox.aspx.cs" Inherits="Asp.net_Sample.Checkbox" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>CheckBoxes</title>
 <script type = "text/javascript">
   function validateCheckBoxList(source, args) {
             var chkListModules = document.getElementById('<%= cblCourses.ClientID %>');
            var chkListinputs = chkListModules.getElementsByTagName("input");
            for (var i = 0; i < chkListinputs.length; i++) {
                if (chkListinputs[i].checked) {
                    args.IsValid = true;
                    return;
                }
            }
            args.IsValid = false;
        }
</script>
</head>

<body>
<form id="form1" runat="server">
<div>
<fieldset style="width:327px">
<legend>Select Your Skills</legend>
    <asp:CheckBoxList ID="cblCourses" runat="server" RepeatColumns="2"
        Width="311px">
        <asp:ListItem>Asp.net</asp:ListItem>
        <asp:ListItem>C#</asp:ListItem>
        <asp:ListItem>VB</asp:ListItem>
        <asp:ListItem>WCF</asp:ListItem>
        <asp:ListItem>Jquery</asp:ListItem>
        <asp:ListItem>JavaScript</asp:ListItem>
    </asp:CheckBoxList>
    <asp:Label ID="lblStatus" runat="server" Text=""></asp:Label>
        <asp:CustomValidator ID="CustomValidator1" runat="server"
        ErrorMessage="Please select at least one skills."
        ClientValidationFunction = "validateCheckBoxList"
        Display="static" ForeColor="Red"></asp:CustomValidator><br />
        <asp:Button ID="btnSubmit" runat="server" Text="Submit"
        onclick="btnSubmit_Click" /> &nbsp;
            <asp:Button ID="btnClearSelection" runat="server" Text="Clear Selection"
        onclick="btnClearSelection_Click" Width="82px" />
            <br />
    <asp:Label ID="lblSelectedValues" runat="server" Text="" style="color: #FF3300"></asp:Label>
        &nbsp;</fieldset> 
</div>
</form>
</body>
</html>




CheckBox.Cs

using System.Collections;


protected void Page_Load(object sender, EventArgs e)
        {
        }
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            if (cblCourses.SelectedIndex != 1)
            {
                lblSelectedValues.Text = "Selectd Values are =" + GetCheckBoxListSelections();
            }
            else
            {
                lblSelectedValues.Text = "Please select Any course";
            }
        }
        private string GetCheckBoxListSelections()
        {
            string[] cblItems;
            ArrayList cblSelections = new ArrayList();
            foreach (ListItem item in cblCourses.Items)
            {
                if (item.Selected)
                {
                    cblSelections.Add(item.Text);
                }
            }
            cblItems = (string[])cblSelections.ToArray(typeof(string));
            return string.Join(",", cblItems); 
        }
        protected void btnClearSelection_Click(object sender, EventArgs e)
        {
            cblCourses.ClearSelection();
            lblSelectedValues.Text = string.Empty;
        }
    }

Output





An A-Z Windows Commands


   ADDUSERS Add or list users to/from a CSV file
   ADmodcmd Active Directory Bulk Modify
   ARP      Address Resolution Protocol
   ASSOC    Change file extension associations•
   ASSOCIAT One step file association
   ATTRIB   Change file attributes
b
   BCDBOOT  Create or repair a system partition
   BOOTCFG  Edit Windows boot settings
   BROWSTAT Get domain, browser and PDC info
c
   CACLS    Change file permissions
   CALL     Call one batch program from another•
   CD       Change Directory - move to a specific Folder•
   CHANGE   Change Terminal Server Session properties
   CHKDSK   Check Disk - check and repair disk problems
   CHKNTFS  Check the NTFS file system
   CHOICE   Accept keyboard input to a batch file
   CIPHER   Encrypt or Decrypt files/folders
   CleanMgr Automated cleanup of Temp files, recycle bin
   CLEARMEM Clear memory leaks
   CLIP     Copy STDIN to the Windows clipboard.
   CLS      Clear the screen•
   CLUSTER  Windows Clustering
   CMD      Start a new CMD shell
   CMDKEY   Manage stored usernames/passwords
   COLOR    Change colors of the CMD window•
   COMP     Compare the contents of two files or sets of files
   COMPACT  Compress files or folders on an NTFS partition
   COMPRESS Compress individual files on an NTFS partition
   CON2PRT  Connect or disconnect a Printer
   CONVERT  Convert a FAT drive to NTFS.
   COPY     Copy one or more files to another location•
   CSCcmd   Client-side caching (Offline Files)
   CSVDE    Import or Export Active Directory data
d
   DATE     Display or set the date•
   DEFRAG   Defragment hard drive
   DEL      Delete one or more files•
   DELPROF  Delete user profiles
   DELTREE  Delete a folder and all subfolders
   DevCon   Device Manager Command Line Utility
   DIR      Display a list of files and folders•
   DIRUSE   Display disk usage
   DISKPART Disk Administration
   DNSSTAT  DNS Statistics
   DOSKEY   Edit command line, recall commands, and create macros
   DSACLs   Active Directory ACLs
   DSAdd    Add items to active directory (user group computer)
   DSGet    View items in active directory (user group computer)
   DSQuery  Search for items in active directory (user group computer)
   DSMod    Modify items in active directory (user group computer)
   DSMove   Move an Active directory Object
   DSRM     Remove items from Active Directory
e
   ECHO     Display message on screen•
   ENDLOCAL End localisation of environment changes in a batch file•
   ERASE    Delete one or more files•
   EVENTCREATE Add a message to the Windows event log
   EXIT     Quit the current script/routine and set an errorlevel•
   EXPAND   Uncompress files
   EXTRACT  Uncompress CAB files
f
   FC       Compare two files
   FIND     Search for a text string in a file
   FINDSTR  Search for strings in files
   FOR /F   Loop command: against a set of files•
   FOR /F   Loop command: against the results of another command•
   FOR      Loop command: all options Files, Directory, List•
   FORFILES Batch process multiple files
   FORMAT   Format a disk
   FREEDISK Check free disk space (in bytes)
   FSUTIL   File and Volume utilities
   FTP      File Transfer Protocol
   FTYPE    Display or modify file types used in file extension associations•
g
   GLOBAL   Display membership of global groups
   GOTO     Direct a batch program to jump to a labelled line•
   GPRESULT Display Resultant Set of Policy information
   GPUPDATE Update Group Policy settings
h
   HELP     Online Help
i
   iCACLS   Change file and folder permissions
   IF       Conditionally perform a command•
   IFMEMBER Is the current user a member of a Workgroup
   IPCONFIG Configure IP
k
   KILL     Remove a program from memory
l
   LABEL    Edit a disk label
   LOCAL    Display membership of local groups
   LOGEVENT Write text to the event viewer
   LOGMAN   Manage Performance Monitor
   LOGOFF   Log a user off
   LOGTIME  Log the date and time in a file
m
   MAPISEND Send email from the command line
   MBSAcli  Baseline Security Analyzer.
   MEM      Display memory usage
   MD       Create new folders•
   MKLINK   Create a symbolic link (linkd)
   MODE     Configure a system device
   MORE     Display output, one screen at a time
   MOUNTVOL Manage a volume mount point
   MOVE     Move files from one folder to another•
   MOVEUSER Move a user from one domain to another
   MSG      Send a message
   MSIEXEC  Microsoft Windows Installer
   MSINFO32 System Information
   MSTSC    Terminal Server Connection (Remote Desktop Protocol)
   MV       Copy in-use files
n
   NET      Manage network resources
   NETDOM   Domain Manager
   NETSH    Configure Network Interfaces, Windows Firewall & Remote access
   NETSVC   Command-line Service Controller
   NBTSTAT  Display networking statistics (NetBIOS over TCP/IP)
   NETSTAT  Display networking statistics (TCP/IP)
   NOW      Display the current Date and Time
   NSLOOKUP Name server lookup
   NTBACKUP Backup folders to tape
   NTRIGHTS Edit user account rights
o
   OPENFILES Query or display open files
p
   PATH     Display or set a search path for executable files•
   PATHPING Trace route plus network latency and packet loss
   PAUSE    Suspend processing of a batch file and display a message•
   PERMS    Show permissions for a user
   PERFMON  Performance Monitor
   PING     Test a network connection
   POPD     Restore the previous value of the current directory saved by PUSHD•
   PORTQRY  Display the status of ports and services
   POWERCFG Configure power settings
   PRINT    Print a text file
   PRINTBRM Print queue Backup/Recovery
   PRNCNFG  Display, configure or rename a printer
   PRNMNGR  Add, delete, list printers set the default printer
   PROMPT   Change the command prompt•
   PsExec     Execute process remotely
   PsFile     Show files opened remotely
   PsGetSid   Display the SID of a computer or a user
   PsInfo     List information about a system
   PsKill     Kill processes by name or process ID
   PsList     List detailed information about processes
   PsLoggedOn Who's logged on (locally or via resource sharing)
   PsLogList  Event log records
   PsPasswd   Change account password
   PsService  View and control services
   PsShutdown Shutdown or reboot a computer
   PsSuspend  Suspend processes
   PUSHD    Save and then change the current directory•
q
   QGREP    Search file(s) for lines that match a given pattern.
r
   RASDIAL  Manage RAS connections
   RASPHONE Manage RAS connections
   RECOVER  Recover a damaged file from a defective disk.
   REG      Registry: Read, Set, Export, Delete keys and values
   REGEDIT  Import or export registry settings
   REGSVR32 Register or unregister a DLL
   REGINI   Change Registry Permissions
   REM      Record comments (remarks) in a batch file•
   REN      Rename a file or files•
   REPLACE  Replace or update one file with another
   RD       Delete folder(s)•
   RMTSHARE Share a folder or a printer
   ROBOCOPY Robust File and Folder Copy
   ROUTE    Manipulate network routing tables
   RUN      Start | RUN commands
   RUNAS    Execute a program under a different user account
   RUNDLL32 Run a DLL command (add/remove print connections)
s
   SC       Service Control
   SCHTASKS Schedule a command to run at a specific time
   SCLIST   Display Services
   SET      Display, set, or remove environment variables•
   SETLOCAL Control the visibility of environment variables•
   SETX     Set environment variables permanently
   SFC      System File Checker
   SHARE    List or edit a file share or print share
   SHIFT    Shift the position of replaceable parameters in a batch file•
   SHORTCUT Create a windows shortcut (.LNK file)
   SHOWGRPS List the Workgroups a user has joined
   SHOWMBRS List the Users who are members of a Workgroup
   SHUTDOWN Shutdown the computer
   SLEEP    Wait for x seconds
   SLMGR    Software Licensing Management (Vista/2008)
   SOON     Schedule a command to run in the near future
   SORT     Sort input
   START    Start a program or command in a separate window•
   SU       Switch User
   SUBINACL Edit file and folder Permissions, Ownership and Domain
   SUBST    Associate a path with a drive letter
   SYSTEMINFO List system configuration
t
   TASKLIST List running applications and services
   TASKKILL Remove a running process from memory
   TIME     Display or set the system time•
   TIMEOUT  Delay processing of a batch file
   TITLE    Set the window title for a CMD.EXE session•
   TLIST    Task list with full path
   TOUCH    Change file timestamps   
   TRACERT  Trace route to a remote host
   TREE     Graphical display of folder structure
   TSSHUTDN Remotely shut down or reboot a terminal server
   TYPE     Display the contents of a text file•
   TypePerf Write performance data to a log file
u
   USRSTAT  List domain usernames and last login
v
   VER      Display version information•
   VERIFY   Verify that files have been saved•
   VOL      Display a disk label•
w
   WAITFOR  Wait for or send a signal
   WHERE    Locate and display files in a directory tree
   WHOAMI   Output the current UserName and domain
   WINDIFF  Compare the contents of two files or sets of files
   WINMSDP  Windows system report
   WINRM    Windows Remote Management
   WINRS    Windows Remote Shell
   WMIC     WMI Commands
   WUAUCLT  Windows Update
x
   XCACLS   Change file and folder permissions
   XCOPY    Copy files and folders
   ::       Comment / Remark•
Commands marked • are Internal commands only available within the CMD shell.
All other commands (not marked with •) are external commands which may be used under the CMD shell, PowerShell, or directly from START-RUN.
Windows RUN Commands, Microsoft Help pages: Windows XP - 2003 Server - 2008 Server
Discussion forum
Links to other sites, books etc...

SqlHelper class

Microsoft has developed and released Application Blocks for Data Access and Exception Management for using in .NET applications. These application blocks provide the .NET developer not only the ready to use code inside the application, but also the code which was built by encapsulating the best practices by Microsoft.

Download SqlHelper.cs Here

SharePoint tenant opt-out for modern lists is retiring in 2019

We're making some changes to how environments can opt out of modern lists in SharePoint. Starting April 1, 2019, we're going to be...