Practical Demo

Practical Demonstration For Dotnet and WP7

Thursday, May 24, 2012

Store and Load Cookies into Gridview

Cookies:

Cookies are a small amount of memory used by web server within Client system. The purpose is maintaining personal info of client within Client system to reduce burden on server.
Ex: Personal information can be login parsers, Session ID, Security tokens, Questions answered by user etc...
Lets we see how cookies are working...
The below code explains a clear view about cookies.
In that one i use two label box and 2 textbox and one button control.
Whenever the user type their name and age into the textbox and Click the button means that information has to be stored in cookies(Temporary Storage).
 If we click the "DisplayCookie button means the stored information in the cookie will be retrieved and load into the GridView..
 Try the Sample demo...





Default.aspx.cs:


using System;

using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Collections;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
HttpCookie aCookie = new HttpCookie("userInfo");
aCookie.Values["uname="] = TextBox1.Text;
aCookie.Values["age="] = TextBox2.Text.ToString();
aCookie.Values["lastVisit="] = DateTime.Now.ToString();
aCookie.Expires = DateTime.Now.AddDays(1);
Response.Cookies.Add(aCookie);
}


protected void Button2_Click(object sender, EventArgs e)
{
ArrayList colCookies = new ArrayList();
for (int i = 0; i < Request.Cookies.Count; i++)
colCookies.Add(Request.Cookies[i]);
GridView1.DataSource = colCookies;
GridView1.DataBind();
}
}









ADD,EDIT,DELETE in DETAILSVIEW without using SQLDATASOURCE


&lt%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %&gt
&lt!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt
&lthtml xmlns="http://www.w3.org/1999/xhtml"&gt
&lthead runat="server"&gt
&lttitle&gt&lt/title&gt
&lt/head&gt
&ltbody&gt
&ltform id="form1" runat="server"&gt
&ltdiv&gt
&ltasp:DetailsView ID="DetailsView1" runat="server" Height="50px" Width="334px" 
AllowPaging="True" AutoGenerateRows="False" CellPadding="4" ForeColor="#333333" 
GridLines="None" OnItemInserting="DetailsView1_ItemInserting" 
OnModeChanging="DetailsView1_ModeChanging" 
OnPageIndexChanging="DetailsView1_PageIndexChanging" 
OnItemDeleting="DetailsView1_ItemDeleting" 
OnItemUpdating="DetailsView1_ItemUpdating" DataKeyNames="eno"&gt
&ltFooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" /&gt
&ltPagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" /&gt
&ltFields&gt
&ltasp:TemplateField HeaderText="Eno"&gt
&ltEditItemTemplate&gt
&ltasp:Label ID="Label2" runat="server" Text='&lt%# Eval("eno") %&gt'&gt&lt/asp:Label&gt
&lt/EditItemTemplate&gt
&ltInsertItemTemplate&gt
&ltasp:TextBox ID="TextBox1" runat="server" &gt&lt/asp:TextBox&gt
&ltasp:TextBox ID="T1" runat="server" &gt&lt/asp:TextBox&gt


&ltasp:Button ID="Button1" runat="server" onclick="Button1_Click" 
Text="Get Ur ID"  /&gt
&lt/InsertItemTemplate&gt
&ltItemTemplate&gt
&ltasp:Label ID="Label1" runat="server" Text='&lt%# Eval("eno") %&gt'&gt&lt/asp:Label&gt
&lt/ItemTemplate&gt
&lt/asp:TemplateField&gt
&ltasp:TemplateField HeaderText="Ename"&gt
&ltEditItemTemplate&gt
&ltasp:TextBox ID="TextBox2" runat="server" Text='&lt%# Eval("ename") %&gt'&gt&lt/asp:TextBox&gt
&lt/EditItemTemplate&gt
&ltInsertItemTemplate&gt
&ltasp:TextBox ID="TextBox3" runat="server"&gt&lt/asp:TextBox&gt
&lt/InsertItemTemplate&gt
&ltItemTemplate&gt
&ltasp:Label ID="Label3" runat="server" Text='&lt%#Eval("ename") %&gt'&gt&lt/asp:Label&gt
&lt/ItemTemplate&gt
&lt/asp:TemplateField&gt
&ltasp:TemplateField HeaderText="Eadd"&gt
&ltEditItemTemplate&gt
&ltasp:TextBox ID="TextBox4" runat="server" Text='&lt%# Eval("eadd") %&gt'&gt&lt/asp:TextBox&gt
&lt/EditItemTemplate&gt
&ltInsertItemTemplate&gt
&ltasp:TextBox ID="TextBox5" runat="server"&gt&lt/asp:TextBox&gt
&lt/InsertItemTemplate&gt
&ltItemTemplate&gt
&ltasp:Label ID="Label4" runat="server" Text='&lt%# Eval("eadd") %&gt'&gt&lt/asp:Label&gt
&lt/ItemTemplate&gt
&lt/asp:TemplateField&gt
&ltasp:TemplateField HeaderText="Esal"&gt
&ltEditItemTemplate&gt
&ltasp:TextBox ID="TextBox6" runat="server" Text='&lt%# Eval("esal") %&gt'&gt&lt/asp:TextBox&gt
&lt/EditItemTemplate&gt
&ltInsertItemTemplate&gt
&ltasp:TextBox ID="TextBox7" runat="server"&gt&lt/asp:TextBox&gt
&lt/InsertItemTemplate&gt
&ltItemTemplate&gt
&ltasp:Label ID="Label5" runat="server" Text='&lt%# Eval("esal") %&gt'&gt&lt/asp:Label&gt
&lt/ItemTemplate&gt
&lt/asp:TemplateField&gt
&ltasp:TemplateField HeaderText="Editing"&gt
&ltEditItemTemplate&gt
&ltasp:LinkButton ID="LinkButton6" runat="server" CommandName="update"&gtUpdate&lt/asp:LinkButton&gt
&ltasp:LinkButton ID="LinkButton7" runat="server" CommandName="cancel"&gtCacel&lt/asp:LinkButton&gt
&lt/EditItemTemplate&gt
&ltInsertItemTemplate&gt
&ltasp:LinkButton ID="LinkButton4" runat="server" CommandName="insert"&gtSave&lt/asp:LinkButton&gt
&ltasp:LinkButton ID="LinkButton5" runat="server" CommandName="cancel"&gtCancel&lt/asp:LinkButton&gt
&lt/InsertItemTemplate&gt
&ltItemTemplate&gt
&ltasp:LinkButton ID="LinkButton1" runat="server" CommandName="edit"&gtEdit&lt/asp:LinkButton&gt
&ltasp:LinkButton ID="LinkButton2" runat="server" CommandName="delete"&gtDelete&lt/asp:LinkButton&gt
&ltasp:LinkButton ID="LinkButton3" runat="server" CommandName="new"&gtNew&lt/asp:LinkButton&gt
&lt/ItemTemplate&gt
&lt/asp:TemplateField&gt
&lt/Fields&gt
&ltHeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" /&gt
&ltAlternatingRowStyle BackColor="White" /&gt
&ltEmptyDataTemplate&gt
NO DATA
&ltasp:LinkButton ID="LinkButton1" runat="server" CommandName="new"&gtAdd Data&lt/asp:LinkButton&gt
&lt/EmptyDataTemplate&gt
&ltCommandRowStyle BackColor="#FFFFC0" Font-Bold="True" /&gt
&ltRowStyle BackColor="#FFFBD6" ForeColor="#333333" /&gt
&ltFieldHeaderStyle BackColor="#FFFF99" Font-Bold="True" /&gt
&lt/asp:DetailsView&gt
&lt/div&gt
&lt/form&gt
&lt/body&gt
&lt/html&gt


Default.aspx.cs:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;

public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
binddetailsView();
}

}

public void binddetailsView()
{

SqlConnection con = new SqlConnection();
con.ConnectionString = "Data Source=.;Initial Catalog=DB_ Name;uid=sa;password=hai";
con.Open();
SqlCommand mySqlCommand = new SqlCommand("SELECT * FROM emp", con);
SqlDataAdapter mySqlAdapter = new SqlDataAdapter(mySqlCommand);
DataSet myDataSet = new DataSet();
mySqlAdapter.Fill(myDataSet);
DetailsView1.DataSource = myDataSet;
DetailsView1.DataBind();
con.Close();

}


protected void DetailsView1_PageIndexChanging(object sender, DetailsViewPageEventArgs e)
{
DetailsView1.PageIndex = e.NewPageIndex;
binddetailsView();

}

protected void DetailsView1_ItemDeleting(object sender, DetailsViewDeleteEventArgs e)
{
SqlConnection con = new SqlConnection();
con.ConnectionString = "Data Source=.;Initial Catalog=DB_ Name;uid=sa;password=hi";

////Update the values.
int ro = int.Parse(datatable().Rows[e.RowIndex][0].ToString());
string delete = "Delete from fees1 where Roll='" + ro + "';";
SqlCommand command = new SqlCommand(delete, con);
con.Open();
command.ExecuteNonQuery();
con.Close();
DetailsView1.ChangeMode(DetailsViewMode.ReadOnly);
binddetailsView();
}

public DataTable datatable()
{
SqlConnection con = new SqlConnection();
con.ConnectionString = "Data Source=.;Initial Catalog=datagrid;uid=sa;password=1soft";
SqlCommand command = new SqlCommand("SELECT * FROM fees1", con);
SqlDataAdapter da = new SqlDataAdapter();
da.SelectCommand = command;
DataTable dt = new DataTable();
da.Fill(dt);
return dt;
}

protected void DetailsView1_ItemInserting(object sender, DetailsViewInsertEventArgs e)
{
SqlConnection con = new SqlConnection();
con.ConnectionString = "Data Source=.;Initial Catalog=DB_ Name;uid=sa;password=hi";


string ename = ((TextBox)(DetailsView1.Rows[1].FindControl("TextBox3"))).Text;
string eadd = ((TextBox)(DetailsView1.Rows[2].FindControl("TextBox5"))).Text;
string esal = ((TextBox)(DetailsView1.Rows[3].FindControl("TextBox7"))).Text;
string insert = "insert into emp(Ename,Eadd,Esal) values ('" + ename + "','" + eadd + "','" + esal + "')";
SqlCommand command = new SqlCommand(insert, con);
con.Open();
command.ExecuteNonQuery();
con.Close();
DetailsView1.ChangeMode(DetailsViewMode.ReadOnly);
binddetailsView();

}



protected void DetailsView1_ItemUpdating(object sender, DetailsViewUpdateEventArgs e)
{
SqlConnection con = new SqlConnection();
con.ConnectionString = "Data Source=.;Initial Catalog=DB_ Name;uid=sa;password=hi";
string eno = ((Label)(DetailsView1.Rows[0].FindControl("Label2"))).Text;
string ename = ((TextBox)(DetailsView1.Rows[1].FindControl("TextBox2"))).Text;
string eadd = ((TextBox)(DetailsView1.Rows[2].FindControl ("TextBox4"))).Text;
string esal = ((TextBox)(DetailsView1.Rows[3].FindControl("TextBox6"))).Text;

string update = "UPDATE emp SET Ename = '" + ename + "', Eadd = '" + eadd + "',Esal='" + esal + "' WHERE Eno = '" + eno + "';";

SqlCommand command = new SqlCommand(update, con);

con.Open();

command.ExecuteNonQuery();

con.Close();
DetailsView1.ChangeMode(DetailsViewMode.ReadOnly);
binddetailsView();

}

protected void DetailsView1_ModeChanging(object sender, DetailsViewModeEventArgs e)
{
if (e.NewMode == DetailsViewMode.Edit)
{
DetailsView1.ChangeMode(DetailsViewMode.Edit);
}
else if (e.NewMode == DetailsViewMode.Insert)
{
DetailsView1.ChangeMode(DetailsViewMode.Insert);

}
else
{
DetailsView1.ChangeMode(DetailsViewMode.ReadOnly);
}
binddetailsView();
}



protected void DetailsView1_DataBound(object sender, EventArgs e)
{

if (((DetailsView)sender).CurrentMode == DetailsViewMode.Edit)
{
}

}



protected void Button1_Click(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection();
con.ConnectionString = "Data Source=.;Initial Catalog=DB_ Name;uid=sa;password=hi";
SqlCommand com = new SqlCommand("select MAX(Eno)+1 from emp", con);
con.Open();
Int32 count = (Int32) com.ExecuteScalar();
string no = count.ToString();

TextBox T1 = new TextBox();
T1.Visible = true;
T1.Text = no;
((TextBox)(DetailsView1.Rows[0].FindControl("T1"))).Text = no;
con.Close();
}
}

Add, Edit,Update Picture Representation for DetailsView





Add New Record:










                                      

Edit the Existing Values:

















ADD,Edit,Update in GRIDVIEW Without SQLDATASOURCE


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>


<!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></title>
</head>
<body background="green-windows-7-wallpapers_11839_1024x768.jpg">
<form id="form1" runat="server">
<div style="width: 1013px">


<asp:GridView ID="GridView1" runat="server" 
onrowcancelingedit="GridView1_RowCancelingEdit" 
onrowediting="GridView1_RowEditing" onrowupdating="GridView1_RowUpdating" 
BackColor="#666699" BorderColor="#996600" BorderStyle="Double" 
BorderWidth="5px" Font-Bold="True" Font-Italic="False" Font-Size="Medium" 
ForeColor="Black" Height="215px" onrowdeleting="GridView1_RowDeleting" 
Width="450px" AutoGenerateColumns="False" AutoGenerateDeleteButton="True" 
AutoGenerateEditButton="True" AutoGenerateSelectButton="True">
<RowStyle BorderColor="Black" />
<Columns>


<asp:BoundField DataField="Roll" HeaderText="Roll No" />
<asp:BoundField DataField="Name" HeaderText="Name" />
<asp:BoundField DataField="Fees" HeaderText="Fees" />
<asp:TemplateField HeaderText="SEX">
<EditItemTemplate>
 <asp:DropDownList ID="DropDownList1" runat="server"
DataTextField="status" Width="127px" DataSource="<%# DropDownValue() %>" DataValueField="status">
</asp:DropDownList>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label5" runat="server" Text='<%# Bind("SEX")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField> 
</Columns>
<HeaderStyle BackColor="#6600CC" ForeColor="White" />
<AlternatingRowStyle BackColor="#FFCCFF" BorderColor="#CC3300" />
</asp:GridView>


<asp:Button ID="Button1" runat="server" onclick="Button1_Click" 
Text="New Entry" />
<br />
<br />
<asp:Label ID="Label1" runat="server" Text="Roll Number:" Font-Bold="True" 
Font-Italic="True" ForeColor="White"></asp:Label>


<asp:TextBox ID="TextBox1" runat="server" style="margin-left: 0px"></asp:TextBox>
<br />
<asp:Label ID="Label2" runat="server" Text="Name" Font-Bold="True" 
Font-Italic="True" ForeColor="White"></asp:Label>
             
<asp:TextBox ID="TextBox2" runat="server" Width="128px"></asp:TextBox>
<br />
<asp:Label ID="Label3" runat="server" Text="Fees" Font-Bold="True" 
Font-Italic="True" ForeColor="White"></asp:Label>
               
<asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>


<br />
<asp:Label ID="Label4" runat="server" BackColor="#000228" Font-Bold="True" 
Font-Italic="True" ForeColor="White" Text="SEX"></asp:Label>
               
<asp:DropDownList ID="DropDownList1" runat="server">
<asp:ListItem>Male</asp:ListItem>
<asp:ListItem>Female</asp:ListItem>
</asp:DropDownList>
<br />
                                     
<asp:Button ID="Button2" runat="server" Height="26px" Text="Submit" 
onclick="Button2_Click" />


</div>
</form>
</body>
</html>

Default.aspx.cs:

Default.aspx.cs:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Configuration;
using System.Data;

public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
TextBox1.Visible = false;
TextBox2.Visible = false;
TextBox3.Visible = false;
Label1.Visible = false;
Label2.Visible = false;
Label3.Visible = false;
Label4.Visible = false;
Button2.Visible = false;
DropDownList1.Visible = false;

if (!IsPostBack)
bindGridView();
SqlConnection con = new SqlConnection();
con.ConnectionString = "Data Source=.;Initial Catalog=datagrid;uid=sa;password=hi";

}
public void bindGridView()  
{      

SqlConnection con = new SqlConnection();
con.ConnectionString = "Data Source=.;Initial Catalog=datagrid;uid=sa;password=hi";


con.Open();      

SqlCommand mySqlCommand = new SqlCommand("SELECT Roll,Name,Fees,SEX FROM fees1", con );
SqlDataAdapter mySqlAdapter = new SqlDataAdapter(mySqlCommand);
DataSet myDataSet = new DataSet();          
mySqlAdapter.Fill(myDataSet);      
GridView1.DataSource = myDataSet;      
GridView1.DataBind();      

con.Close();      

}
protected DataTable DropDownValue()
{
SqlConnection con = new SqlConnection();
con.ConnectionString = "Data Source=.;Initial Catalog=datagrid;uid=sa;password=hi";

string Sqlquery = "SELECT status FROM master_status";
SqlDataAdapter dtadapter = new SqlDataAdapter(Sqlquery, con);
DataTable dt = new DataTable();
dtadapter.Fill(dt);
return dt;
}
protected void GridView1_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)
{
GridView1.EditIndex = -1;
bindGridView();
}
protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
{
GridView1.EditIndex = e.NewEditIndex;
bindGridView();
}
protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
{

SqlConnection con = new SqlConnection();
con.ConnectionString = "Data Source=.;Initial Catalog=datagrid;uid=sa;password=hi";


////Update the values.
int ro = int.Parse(((TextBox)GridView1.Rows[e.RowIndex].Cells[1].Controls[0]).Text);
string na = ((TextBox)GridView1.Rows[e.RowIndex].Cells[2].Controls[0]).Text;
string fe = ((TextBox)GridView1.Rows[e.RowIndex].Cells[3].Controls[0]).Text;
DropDownList ddl = (DropDownList)GridView1.Rows[e.RowIndex].Cells[4].FindControl("DropDownList1");
string se = ddl.SelectedValue;


string update = "UPDATE fees1 SET Name = '" + na +"', Fees = '" +fe  +"',SEX='"+se+"' WHERE Roll = '" + ro +"';";

SqlCommand command = new SqlCommand(update, con);

con.Open();

command.ExecuteNonQuery();

con.Close();

////Reset the edit index.
GridView1.EditIndex = -1;

////Bind data to the GridView control.
bindGridView();



}
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
SqlConnection con = new SqlConnection();
con.ConnectionString = "Data Source=.;Initial Catalog=datagrid;uid=sa;password=hi";

int ro = int.Parse(datatable().Rows[e.RowIndex][0].ToString());
string delete = "DELETE FROM fees1 WHERE Roll =  '" + ro + "';";
SqlCommand command = new SqlCommand(delete, con);
con.Open();
command.ExecuteNonQuery();
con.Close();
GridView1.EditIndex = -1;
bindGridView();
}
public DataTable datatable()
{
SqlConnection con = new SqlConnection();
con.ConnectionString = "Data Source=.;Initial Catalog=datagrid;  uid=sa;password=hi";
SqlCommand command = new SqlCommand("SELECT * FROM fees1", con);
SqlDataAdapter da = new SqlDataAdapter();
da.SelectCommand = command;
DataTable dt = new DataTable();
da.Fill(dt);
return dt;
}


protected void Button1_Click(object sender, EventArgs e)
{
TextBox1.Visible = true;
TextBox1.Text = "";
TextBox2.Visible = true;
TextBox2.Text = "";
TextBox3.Visible = true;
TextBox3.Text = "";
Label1.Visible = true;
Label2.Visible = true;
Label3.Visible = true;
Label4.Visible = true;
Button2.Visible = true;
DropDownList1.Visible = true;
}
protected void Button2_Click(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection();
con.ConnectionString = "Data Source=.;Initial Catalog=datagrid;uid=sa;password=hi";
SqlCommand cmd = new SqlCommand();
con.Open();

cmd = new SqlCommand("INSERT INTO fees1(Name,Fees,SEX) VALUES ('"+TextBox2 .Text +"','"+TextBox3 .Text +"','"+DropDownList1.Text+"')",con );

cmd.ExecuteNonQuery();
con.Close();
bindGridView();


}
}

Add, Edit, Update Picture Representation for GridView


Add New Entry into the GridView:









Edit the Existing Value in GridView:





















Repeater Demo


Output of an Repeater Control:








REPEATER SAMPLE CODING


Default.aspx:

&lt%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %&gt


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


&lthtml xmlns="http://www.w3.org/1999/xhtml"&gt
&lthead runat="server"&gt
&lttitle&gtUntitled Page&lt/title&gt
&lt/head&gt
&ltbody&gt
&ltform id="form1" runat="server"&gt
&ltdiv&gt


&ltasp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSource1"&gt
&ltHeaderTemplate&gt
&lttable border="1" width="40%"&gt
&lttr bgcolor="#807050"&gt
&ltth&gtID&lt/th&gt
&ltth&gtNAME&lt/th&gt
&ltth&gtAGE&lt/th&gt
&lt/tr&gt
&lt/HeaderTemplate&gt


&ltItemTemplate&gt
&lttr bgcolor="#809850"&gt
&lttd&gt &lt%# DataBinder.Eval(Container.DataItem, "id") %&gt&lt/td&gt
&lttd&gt &lt%# DataBinder.Eval(Container.DataItem, "name") %&gt&lt/td&gt
&lttd&gt  &lt%# DataBinder.Eval(Container.DataItem, "age") %&gt&lt/td&gt
&lt/tr&gt
&ltbr/&gt
&lt/ItemTemplate&gt
&ltAlternatingItemTemplate&gt
&lttr bgcolor="White"&gt
&lttd&gt&lt%# DataBinder.Eval(Container.DataItem, "id")%&gt&lt/td&gt
&lttd&gt&lt%# DataBinder.Eval(Container.DataItem, "name")%&gt&lt/td&gt
&lttd&gt&lt%# DataBinder.Eval(Container.DataItem, "age")%&gt&lt/td&gt
&lt/tr&gt


&lt/AlternatingItemTemplate&gt
&lt/asp:Repeater&gt


&ltasp:SqlDataSource ID="SqlDataSource1" runat="server" 
ConnectionString="&lt%$ ConnectionStrings:jasConnectionString %&gt" 
SelectCommand="SELECT * FROM [emp]"&gt&lt/asp:SqlDataSource&gt


&ltbr /&gt
&ltbr /&gt




&lt/div&gt
&lt/table&gt
&lt/form&gt
&lt/body&gt
&lt/html&gt

ListView Demo with SqlDataSource with Picture Representation


Inserting New Record Values in ListView:









Editing and Updating in Listview:







Deleting in Listview:





ListView Add,Edit,Updating Coding


Default.aspx:
&lt%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %&gt


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


&lthtml xmlns="http://www.w3.org/1999/xhtml"&gt
&lthead runat="server"&gt
&lttitle&gtComplete List View&lt/title&gt
&lt/head&gt
&ltbody&gt
&ltform id="form1" runat="server"&gt
&ltdiv&gt


&ltasp:ListView ID="ListView1" runat="server" DataSourceID="SqlDataSource1" 
onsorting="ListView1_Sorting"  InsertItemPosition="LastItem" 
onitemcommand="ListView1_ItemCommand" &gt
&ltLayoutTemplate&gt
&lttable border="0" cellpadding="1"&gt
&lttr style="background-color:#E5E5FE"&gt
&ltth align="left"&gt&ltasp:LinkButton ID="lnkId" runat="server" CommandName="Sort" CommandArgument="ID"&gtID&lt/asp:LinkButton&gt&lt/th&gt
&ltth align="left"&gt&ltasp:LinkButton ID="lnkName" runat="server" CommandName="Sort" CommandArgument="FirstName"&gtNAME&lt/asp:LinkButton&gt&lt/th&gt
&ltth align="left"&gt&ltasp:LinkButton ID="lnkType" runat="server" CommandName="Sort" CommandArgument="ContactType"&gtAGE&lt/asp:LinkButton&gt&lt/th&gt
&ltth&gt&lt/th&gt
&lt/tr&gt
&lttr id="itemPlaceholder" runat="server"&gt&lt/tr&gt
&lt/table&gt
&ltasp:DataPager ID="ItemDataPager" runat="server" PageSize="5"&gt
&ltFields&gt
&ltasp:NumericPagerField ButtonCount="2" /&gt
&lt/Fields&gt
&lt/asp:DataPager&gt    
&lt/LayoutTemplate&gt
&ltItemTemplate&gt
&lttr&gt
&lttd&gt&ltasp:Label runat="server" ID="lblId"&gt&lt%#Eval("id") %&gt&lt/asp:Label&gt&lt/td&gt
&lttd&gt&ltasp:Label runat="server" ID="lblName"&gt&lt%#Eval("name")%&gt&lt/asp:Label&gt&lt/td&gt
&lttd&gt&ltasp:Label runat="server" ID="lblType"&gt&lt%#Eval("age") %&gt&lt/asp:Label&gt&lt/td&gt
&lttd&gt&ltasp:LinkButton ID="lnkEdit" runat="server" CommandName="Edit"&gtEdit&lt/asp:LinkButton&gt&lt/td&gt
&lt/tr&gt
&lt/ItemTemplate&gt
&ltAlternatingItemTemplate&gt
&lttr style="background-color:#EFEFEF"&gt
&lttd&gt&ltasp:Label runat="server" ID="lblId"&gt&lt%#Eval("id") %&gt&lt/asp:Label&gt&lt/td&gt
&lttd&gt&ltasp:Label runat="server" ID="lblName"&gt&lt%#Eval("name")%&gt&lt/asp:Label&gt&lt/td&gt
&lttd&gt&ltasp:Label runat="server" ID="lblType"&gt&lt%#Eval("age") %&gt&lt/asp:Label&gt&lt/td&gt
&lttd&gt&ltasp:LinkButton ID="lnkEdit" runat="server" CommandName="Edit"&gtEdit&lt/asp:LinkButton&gt&lt/td&gt
&lt/tr&gt
&lt/AlternatingItemTemplate&gt
&ltEditItemTemplate&gt
&lttd&gt
&ltasp:TextBox ID="txtUpId" runat="server" Text='&lt%#Eval("id") %&gt' Enabled="false" Width="20px"&gt&lt/asp:TextBox&gt
&lt/td&gt
&lttd&gt
&ltasp:TextBox ID="txtUpFname" runat="server" Text='&lt%#Eval("name") %&gt' Width="100px"&gt&lt/asp:TextBox&gt
&lt/td&gt
&lttd&gt
&ltasp:TextBox ID="txtUpCtype" runat="server" Width="100px" Text='&lt%#Eval("age") %&gt'&gt&lt/asp:TextBox&gt
&lt/td&gt
&lttd&gt   
&ltasp:LinkButton ID="lnkUpdate" runat="server" CommandName="Update"&gtUpdate&lt/asp:LinkButton&gt
&ltasp:LinkButton ID="lnkDelete" runat="server" CommandName="Delete"&gtDelete&lt/asp:LinkButton&gt
&ltasp:LinkButton ID="lnkCancel" runat="server" CommandName="Cancel"&gtCancel&lt/asp:LinkButton&gt
&lt/td&gt


&lt/tr&gt
&lt/EditItemTemplate&gt
&ltInsertItemTemplate&gt
&lttr runat="server"&gt
&lttd&gt&lt/td&gt
&lttd&gt
&ltasp:TextBox ID="txtFname" runat="server" Text='&lt%#Eval("id") %&gt' Width="100px"&gtid&lt/asp:TextBox&gt
&ltasp:TextBox ID="txtLname" runat="server" Text='&lt%#Eval("name") %&gt' Width="100px"&gt Name&lt/asp:TextBox&gt
&lt/td&gt
&lttd&gt&ltasp:TextBox ID="txtCtype" runat="server" Text='&lt%#Eval("age") %&gt' Width="100px"&gtage&lt/asp:TextBox&gt&lt/td&gt
&lttd&gt&ltasp:Button ID="InsertButton" runat="server" CommandName="Insert" Text="Insert" /&gt&lt/td&gt




&lt/tr&gt
&lt/InsertItemTemplate&gt


&lt/asp:ListView&gt
&ltasp:SqlDataSource ID="SqlDataSource1" runat="server" 
ConnectionString="&lt%$ ConnectionStrings:gridConnectionString2 %&gt" 
SelectCommand="SELECT * FROM [emp]"&gt&lt/asp:SqlDataSource&gt


&ltbr /&gt
&ltbr /&gt


&lt/div&gt
&lt/form&gt
&lt/body&gt
&lt/html&gt


Default.aspx.cs
using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

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

}
protected void ListView1_Sorting(object sender, ListViewSortEventArgs e)
{

}

protected void ListView1_ItemCommand(object sender, ListViewCommandEventArgs e)
{
if (e.CommandName == "Insert")
{
TextBox txtFname = (TextBox)e.Item.FindControl("txtFname");
TextBox txtLname = (TextBox)e.Item.FindControl("txtLname");
TextBox txtCtype = (TextBox)e.Item.FindControl("txtCtype");
string insertCommand = "Insert into [emp] ([id],[name],[age]) Values('" + txtFname.Text + "', '" + txtLname.Text + "', '" + txtCtype.Text + "');";
SqlDataSource1.InsertCommand = insertCommand;
}
else if (e.CommandName == "Update")
{
TextBox txtId = (TextBox)e.Item.FindControl("txtUpId");
TextBox txtFname = (TextBox)e.Item.FindControl("txtUpFname");
//TextBox txtLname = (TextBox)e.Item.FindControl("txtUpLname");
TextBox txtCtype = (TextBox)e.Item.FindControl("txtUpCtype");
string updateCommand = "Update [emp] set [name]='"+txtFname.Text+"', [age]='"+txtCtype.Text+"' where id="+Convert.ToInt32(txtId.Text)+";";
SqlDataSource1.UpdateCommand = updateCommand;
}
else if (e.CommandName == "Delete")
{
TextBox txtId = (TextBox)e.Item.FindControl("txtUpId");
string deleteCommand = "delete from [emp] where id="+Convert.ToInt32(txtId.Text);
SqlDataSource1.DeleteCommand = deleteCommand;
}
}
}

LINQ TO Object Sample




LINQ:



          LINQ stands for “Language Integrated Query”.



Different datastores has got different query languages. Microsoft’s idea is providing one query language syntax to all the datastors to make developer job easier.



This lead to invention of LINQ with .NET3.5



LINQ is a concept of performing queries based on language syntax.







LINQ syntax:



           var res= from variablename in source



                           where condition



                           group by...



                           order by...



                           select variablename;







     source can be database, object, xml document.







LINQ can be classified into 3 types:







   1) LINQ to Object.



   2) LINQ to SQL.



   3) LINQ to XML.







LINQ to object:



           Applying linq query expression to object is called “Linq to object”.



 Ex:



      Int[]a={2,5,6,7,1,3};



//Display number>=5



      var res = from aa in a



                     where aa>=5



                     order by aa descending



                     select aa;



LINQ Samples: Restriction Operators







Where - Simple 1



This sample uses where to find all elements of an array less than 5.










public void Linq1()



{



    int[] numbers = { 5, 4, 1, 3, 9, 8, 6, 7, 2, 0 };







    var lowNums =



        from n in numbers



        where n < 5



        select n;







    Console.WriteLine("Numbers < 5:");



    foreach (var x in lowNums)



    {



        Console.WriteLine(x);



    }



}







Result



Numbers < 5:
4
1
3
2
0



Where - Indexed



This sample demonstrates an indexed Where clause that returns digits whose name is shorter than their value.



public void Linq5()



{



    string[] digits = { "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine" };







    var shortDigits = digits.Where((digit, index) => digit.Length < index);







    Console.WriteLine("Short digits:");



    foreach (var d in shortDigits)



    {



        Console.WriteLine("The word {0} is shorter than its value.", d);



    }



}







Result



Short digits:
The word five is shorter than its value.
The word six is shorter than its value.
The word seven is shorter than its value.
The word eight is shorter than its value.
The word nine is shorter than its value.





Working with LINQ TO SQL Example




LINQ to SQL Example:



1) In Microsoft Visualstudio2008, Select FileĆ New Ć Project and select ASP.NET Web Application and give name as LINQQQ.



2) In Default.aspx page design the webpage as given below.






3) Create the database named “linqsamples” and create the table employee with the required field given below.




    


Turn off the Identity Specification to “NO”.



4) After creating the Database next we have to create dbml in our application. To do this , following the steps given below.



     a) choose Project menuĆ  Add New Item and select “LINQ to SQL Classes” and give name as employee.dbml.






     b) In Solution Explorer double click the “employee.dbml” and in that file drag oue employee table and drop it.









    







c) In Default.aspx.cs, type the following code:



using System;



using System.Collections.Generic;



using System.Linq;



using System.Web;



using System.Web.UI;



using System.Web.UI.WebControls;







namespace LINQQQ



{



    public partial class _Default : System.Web.UI.Page



    {



       



         DAL dal = new DAL();       



        protected void Page_Load(object sender, EventArgs e)



        {



            if (!Page.IsPostBack)



            {



                BindGrid();



            }



        }







        protected void btnSave_Click(object sender, EventArgs e)



        {



            employee emp = new employee();







            emp.ID = int.Parse( txtID.Text);



            emp.name = txtName.Text;



            emp.description = txtDesc.Text;



            dal.SaveEmployee(emp);



            BindGrid();



        }







        private void BindGrid()



        {



            gvEmployees.DataSource = dal.GetAllEmployees();



            gvEmployees.DataBind();



        }







        protected void gvEmployees_RowCommand(object sender, GridViewCommandEventArgs e)



        {



            hdnID.Value = e.CommandArgument.ToString();



            if (e.CommandName == "EditEmployee")



            {



                //employee emp = new employee();



               employee emp = GetEmployee(Convert.ToInt32(hdnID.Value));



                txtName.Text = emp.name;



                txtDesc.Text = emp.description;



                btnSave.Visible = false;



                btnUpdate.Visible = true;



            }



            else if (e.CommandName == "DeleteEmployee")



            {



                dal.DeleteEmployee(Convert.ToInt32(hdnID.Value));



                BindGrid();



            }



        }







      



       private employee GetEmployee(int ID)



        {



           employee emp = dal.GetEmployees(ID);



            return emp;



        }



       







        private void ClearScreen()



        {



            txtName.Text = string.Empty;



            txtDesc.Text = string.Empty;



        }







       protected void btnUpdate_Click(object sender, EventArgs e)



        {



            employee emp = new employee();



            emp.ID = Convert.ToInt32(hdnID.Value);



            emp.name = txtName.Text;



            emp.description = txtDesc.Text;



            dal.UpdateEmployee(emp);



            BindGrid();



        }



    }



   }







d) Now you have to create a new class file named DAL.cs.



   Choose ProjectĆ AddNewItem and select class file and give name as “DAL.cs”



“DAL.cs” class file is mainly used to create the methods for Inserting, Updating and Deleting records in a nice manner.



    BY way of creating object to the class we have to access the methods in the class.



   Ex:



         DAL dal=new DAL();







Now in DAL.cs Class file type the following code:







DAL.cs:







using System;



using System.Collections.Generic;



using System.Linq;



using System.Web;







namespace LINQQQ



{



    public class DAL



    {



        employeeDataContext context = new employeeDataContext();



        public List<employee> GetAllEmployees()



        {



            Open();



            var Res = context.employees.ToList();



            Close();



            return Res;



        }



        private void Open()



        {



            context.Connection.Open();



        }







        private void Close()



        {



            context.Connection.Close();



        }



        public List<employee> GetEmployees(string Search)



        {



            Open();



            var Res = (from emp in context.employees



                       where emp.name.Contains(Search)



                       select emp).ToList();



            Close();



            return Res;



        }



        public void SaveEmployee(employee emp)



        {



            Open();



            this.context.employees.InsertOnSubmit(emp);



            this.context.SubmitChanges();



            Close();



        }



        public void UpdateEmployee(employee emp)



        {



            Open();



            var employee = (from em in this.context.employees



                            where em.ID == emp.ID



                            select em).First();



            employee.name = emp.name;



            employee.description = emp.description;



            this.context.SubmitChanges();



            Close();



        }



        public void DeleteEmployee(int ID)



        {



            Open();



            var emp = (from em in this.context.employees



                       where em.ID == ID



                       select em).First();



            this.context.employees.DeleteOnSubmit(emp);



            this.context.SubmitChanges();



            Close();



        }



        public employee GetEmployees(int ID)



        {



            Open();



            var emp = (from em in this.context.employees



                       where em.ID == ID



                       select em).First();



            Close();



            return emp;







        }



    }



}







   e) Now run the project LINQ works perfect..



       All the Best... J


Introduction to Dotnet

.NET framework is an essential component of the windows operating system and helps create applications by integrating different programming languages, such as Visual C#, Visual Basic, Visual C++, and so on. .NET Framework consists of a virtual execution syatem called the common language runtime(CLR) and a set of class libraries. CLR is a Microsoft product of the Common Language Infrastructure(CLI), which is an industrial standard and a basis for creating execution and development environmentss in which languages and libraries work together. Microsoft introduced .NET to bridge the gap and ensure interoperability between application created in different languages. .NET framework is used to integrate the business logic of an application implemented in different programming languages and services. Consequently, it induces significant improvements in code reusability, code specialization, resource management, development of applications in multiple programming languages, security, deployment, and administration of programs developed in multiple programming languages..

Why .NET?

Why .NET? Mainly .NET is the competitor for JAVA. . Its an environment or platform. It contains collection of services for application development and application execution. It supports different type of applications development. ex: CUI, GUI, console, web based,mobile applications Main thing is .NET is network & Internet based application development.It provides a good development environment. ex: Drag and Drop design - IntelliSense features - Syntax highlighting and auto-syntax checking - Excellent debugging tools - Integration with version control software such as Visual Source Safe (VSS) - Easy project management

Flavors of .NET:

Contrary to general belief .NET is not a single technology. Rather it is a set of technologies that work together seamlessly to solve your business problems. The following sections will give you insight into various flavors and tools of .NET and what kind of applications you can develop. • What type of applications can I develop? When you hear the name .NET, it gives a feeling that it is something to do only with internet or networked applications. Even though it is true that .NET provides solid foundation for developing such applications it is possible to create many other types of applications. Following list will give you an idea about various types of application that we can develop on .NET. 1. ASP.NET Web applications: These include dynamic and data driven browser based applications. 2. Windows Form based applications: These refer to traditional rich client applications. 3. Console applications: These refer to traditional DOS kind of applications like batch scripts. 4. Component Libraries: This refers to components that typically encapsulate some business logic. 5. Windows Custom Controls: As with traditional ActiveX controls, you can develop your own windows controls. 6. Web Custom Controls: The concept of custom controls can be extended to web applications allowing code reuse and modularization. 7. Web services: They are “web callable” functionality available via industry standards like HTTP, XML and SOAP. 8. Windows Services: They refer to applications that run as services in the background. They can be configured to start automatically when the system boots up. As you can clearly see, .NET is not just for creating web application but for almost all kinds of applications that you find under Windows.

Evaluation of .NET:

Around 1995, Java was gaining popularity because of its platform-independent approach and Sun Microsyatem's open source policy. Later in 2002, Sun Microsystems released the enterprise edition of Java. ie., Java 2 Enterprise edition(J2EE), which is a Java Platform to develop and execute distributed Java Applications based on the N-tier architecture. The advent of J2EE eventually led to the decline of, Microsoft's Market share. Consequently, Microsoft started a project called NEXT GENERATION WINDOWS SERVICE(NGWS) to regain the market share . It tooks more than three years to develop the product, Which is Known as .NET. Microsoft released the first version of .NET with the name .NET Framework 1.0 on february 13,2002, along with the Visual studio .NET 2002 integrated development environment(IDE). .NET's Second revised version took nearly a year to release; and it was known as .NET framework 1.1 Microsoft Visual studio .NET, bettre known as Visual studio .NET2003, was also a part of the second release. The next version of .NET framework, .NET Framework 2.0, was released with Visual studio .NET 2005 on november 07,2005. .NET framework 3.0 formerly called WinFX, was released on novenber 06,2006. Finally the latest version of .NET framework, known as .NET framework 3.5, was released with Visual studio .NET2008 on november 19,2007.

Feature of .NET

Features of .NET Now that we know some basics of .NET, let us see what makes .NET a wonderful platform for developing modern applications. • Rich Functionality out of the box .NET framework provides a rich set of functionality out of the box. It contains hundreds of classes that provide variety of functionality ready to use in your applications. This means that as a developer you need not go into low level details of many operations such as file IO, network communication and so on. • Easy development of web applications ASP.NET is a technology available on .NET platform for developing dynamic and data driven web applications. ASP.NET provides an event driven programming model (similar to Visual Basic 6 that simplify development of web pages (now called as web forms) with complex user interface. ASP.NET server controls provide advanced user interface elements (like calendar and grids) that save lot of coding from programmer’s side. • OOPs Support The advantages of Object Oriented programming are well known. .NET provides a fully object oriented environment. The philosophy of .NET is – “Object is mother of all.” Languages like Visual Basic.NET now support many of the OO features that were lacking traditionally. Even primitive types like integer and characters can be treated as objects – something not available even in OO languages like C++. • Multi-Language Support Generally enterprises have varying skill sets. For example, a company might have people with skills in Visual Basic, C++, and Java etc. It is an experience that whenever a new language or environment is invented existing skills are outdated. This naturally increases cost of training and learning curve. .NET provides something attractive in this area. It supports multiple languages. This means that if you have skills in C++, you need not throw them but just mould them to suit .NET environment. Currently four languages are available right out of the box namely – Visual Basic.NET, C# (pronounced as C-sharp), Jscript.NET and Managed C++ (a dialect of Visual C++). There are many vendors that are working on developing language compilers for other languages (20+ language compilers are already available). The beauty of multi language support lies in the fact that even though the syntax of each language is different, the basic capabilities of each language remain at par with one another. • Multi-Device Support Modern lift style is increasingly embracing mobile and wireless devices such as PDAs, mobiles and handheld PCs. . . .NET provides promising platform for programming such devices. .NET Compact Framework and Mobile Internet Toolkit are step ahead in this direction. • Automatic memory management While developing applications developers had to develop an eye on system resources like memory. Memory leaks were major reason in failure of applications. .NET takes this worry away from developer by handling memory on its own. The garbage collector takes care of freeing unused objects at appropriate intervals. • Compatibility with COM and COM+ Before the introduction of .NET, COM was the de-facto standard for componentized software development. Companies have invested lot of money and efforts in developing COM components and controls. The good news is – you can still use COM components and ActiveX controls under .NET. This allows you to use your existing investment in .NET applications. .NET still relies on COM+ for features like transaction management and object pooling. In fact it provides enhanced declarative support for configuring COM+ application right from your source code. Your COM+ knowledge still remains as a valuable asset. • No more DLL Hell If you have worked with COM components, you probably are aware of “DLL hell”. DLL conflicts are a common fact in COM world. The main reason behind this was the philosophy of COM – “one version of component across machine”. Also, COM components require registration in the system registry. .NET ends this DLL hell by allowing applications to use their own copy of dependent DLLs. Also, .NET components do not require any kind of registration in system registry. • Strong XML support Now days it is hard to find a programmer who is unaware of XML. XML has gained such a strong industry support that almost all the vendors have released some kind of upgrades or patches to their existing software to make it “XML compatible”. Currently, .NET is the only platform that has built with XML right into the core framework. .NET tries to harness power of XML in every possible way. In addition to providing support for manipulating and transforming XML documents, .NET provides XML web services that are based on standards like HTTP, XML and SOAP. • Ease of deployment and configuration Deploying windows applications especially that used COM components were always been a tedious task. Since .NET does not require any registration as such, much of the deployment is simplified. This makes XCOPY deployment viable. Configuration is another area where .NET – especially ASP.NET – shines over traditional languages. The configuration is done via special files having special XML vocabulary. Since, most of the configuration is done via configuration files, there is no need to sit in front of actual machine and configure the application manually. This is more important for web applications; simply FTPing new configuration file makes necessary changes. • Security Windows platform was always criticized for poor security mechanisms. Microsoft has taken great efforts to make .NET platform safe and secure for enterprise applications. Features such as type safety, code access security and role based authentication make overall application more robust and secure.
Don't Be A Computer Virus Victim
How To Avoid Computer Virus?

I think it's great that Macs enjoy "virus protections" that the PC doesn't. But if you think you're 'safe' because you're trusting the computer, consider the fact that the vast majority of PC users aren't on Macs, so hackers don't bother to write viruses for them. Knowing that, you still must understand that viruses get triggered not because the computer is a PC but because the user isn't paying attention.
Don't blame PCs, blame users. As long as users continue to allow their email programs to automatically launch files, idiocy like the Sobig virus will continue. This was the fifth version of this virus and they keep getting nastier than their predecessors.
It takes simple common sense and a lot of meticulousness to keep from launching viruses but it's not hard. Here's a list of the precautions I take to avoid computer viruses.
Don't download anything from anyone you don't know or aren't expecting... EVER. For all you VAs, and publishers and whoever else out there is trading files back and forth with your clients... Stop and make sure that your client has a safe system before you start trading files with them. It's worth the time.
2. Turn off the autolaunch in your email client. I don't even auto-launch graphics. Furthermore, READ YOUR EMAIL ONLINE! Don't download the email until you're 100% sure it is safe. Use Netscape, use Yahoo, use Eudora, use Simplecheck; I'm sure there are others.
3. If your email has an attachment, go into your headers and look at it. If it's got a pif or scr extension, chances are it's a virus. If it's any Microsoft program file, and you aren't expecting it, it in itself probably isn't a virus, but it could very easily have a virus embedded in it. The only things that hacker's haven't been able to embed viruses into, to my knowledge, are pictures. But just because it says it's a picture doesn't mean it is. Look at the attachment name. File names don't lie. If it's a .jpg.scr extension, it's a virus.
4. Antivirus protection programs are only ever as up to date as known viruses. They are also the first target of a virus, so don't trust the antivirus protection program alone. If you've used your eyes and don't believe it's a virus, scan it anyway. I use Yahoo, because they keep Norton up to date and I don't have to run it on my system. Norton in and of itself is a great antivirus protection program, but it's not infallible.
5. Set your computer so it doesn't autolaunch files, updates, security checks, html pages, cookies, etc. without your permission!
6. Get a quality anti-spyware program - They're designed to get rid of programs on your system that send your data to the web and as such could be opening holes that you don't know about.
7. Set up a software firewall. If you don't have a software firewall built in, upgrade your OS. And make sure everyone on your LAN is set up with the same firewall.
8. Don't rely only on the software; set up a hardware firewall. It's called a router and it's easy to set up and maintain.
9. Take the time and make the effort to understand how viruses and worms get onto your computer and you can virtually stop them all in their tracks.
10. Once you've got all your holes closed, get someone who knows what they're doing to test it from the Internet side. If you don't have someone, I can refer someone.
11. Don't let kids on the 'Net on your system! I find it funny that businesses will spend billions of dollars on marketing and advertising, but they leave their computer systems open to hackers whose sole purpose in life is to take advantage of KNOWN cracks in the system. In my opinion, the only real hole is the User. If you don't protect your system, nobody else will.
I probably sound a little cocky telling everyone my anti-virus procedures like this, but I'm not really. I have very sensitive data on my system I cannot afford to lose or to have sent out willy nilly to the Internet. So I'm cautious. I'm also smart enough to know that the second I let my guard down, something is going to find its way in and I won't be able to say "never" again. But I don't intend to let my guard down.
And if anyone out there is serious about doing everything you can to stop from getting a virus, but don't have the computer literacy to feel you can do it, email me and I'll find the time to help you put it all together.
Twitter Bird Gadget