Category: Random



Many times you must have come across a common problem where videos are not loding onto youtube website and you can just see a spinning circle animation again and again.

Well problem can be solved very easily by following simple steps demonstrated in below video. Also don’t forget to give a thumbs up if it solves the issue for you.


CCNA – Get 80% off in discount fees


My entire CCNA journey, complete details and the way to acquire the discount voucher to get 80% off in exam fees of CCNA, everything in below video.

Elitmus syllabus 2021


Please find below the detailed video on latest syllabus of elitmus 2021 with new updates. Also find answers to lot of other questions based on elitmus.

Do subscribe our youtube channel to be updated with all elitmus drives and job opportunities.

The IT story in few simple words



Many time you may face issues where you are unable to format your memory card or pen drive, in order to solve the issue you can format it using command prompt:

To open the DOS prompt (Start >> Run >> cmd)

Type:
FORMAT X: /S

This will reformat the memory card/ Pen drive. Replace X: with the actual drive letter of your Pen Drive or memory card.

Simple Login Program in C#.NET


ASPX PAGE:

<%@ 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”&gt;

<html xmlns=”http://www.w3.org/1999/xhtml”&gt;
<head runat=”server”>
    <title></title>
</head>
<body>
    <form id=”form1″ runat=”server”>
    <div>
        <asp:Label ID=”Label1″ runat=”server” Text=”User Name”></asp:Label>
<asp:TextBox ID=”UserNameTextBox” runat=”server”></asp:TextBox>
        <br />
        <asp:Label ID=”Label2″ runat=”server” Text=”Password”></asp:Label>
        <asp:TextBox ID=”PasswordTextBox” runat=”server”></asp:TextBox>
        <br />
        <br />
        <asp:Button ID=”SubmittButton” runat=”server” onclick=”SubmittButton_Click” Text=”Submitt” />
        <asp:Label ID=”ResultLabel” runat=”server”></asp:Label>
    </div>
    </form>
</body>
</html>

ASPX.CS PAGE:

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)
    {

    }
    protected void SubmittButton_Click(object sender, EventArgs e)
    {
        SqlConnection con = new SqlConnection(“Server=DEEPAK-PC;Database=Practice;trusted_connection=true”);
        SqlCommand cmd = new SqlCommand(“CheckForLogin”, con);
        con.Open();
        cmd.CommandType = CommandType.StoredProcedure;
        cmd.Parameters.AddWithValue(“@UserName”, UserNameTextBox.Text);
        cmd.Parameters.AddWithValue(“@Password”, PasswordTextBox.Text);
        int res = Convert.ToInt32(cmd.ExecuteScalar());
        if (res == 1)
            ResultLabel.Text = “Success”;
        else
            ResultLabel.Text = “Fail”;

    }
}

DATABASE CODING:

–To create table

Create table Login
(
UserName varchar(20),
Password varchar(20)
)

–To view Table

select * from Login

–To Insert value in table

insert into Login values(‘deepak’,’DEEPAK’)

–To create procedure
create proc CheckForLogin
(@UserName varchar(20), @Password varchar(20))
as
begin
select count(*) from Login where Username=@UserName and Password=@Password
end


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 Department : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

//to populate the country name in dropdown
        if (!IsPostBack)
        {

            SqlConnection deptConnection = new SqlConnection(“Server=.;Database=Login;trusted_connection=true”);
            SqlCommand deptCommand = new SqlCommand(“Select * from Country”, deptConnection);           //Country is a table
            deptConnection.Open();
            SqlDataReader reader = deptCommand.ExecuteReader();
            DLocationDropDownList.DataSource = reader;
            DLocationDropDownList.DataTextField = “CountryName”;
            DLocationDropDownList.DataValueField = “CountryId”;
            DLocationDropDownList.DataBind();

        }
        

    }
    protected void AddDeptButton_Click(object sender, EventArgs e)
    {
        SqlConnection deptConnection = new SqlConnection(“Server=.;Database=Login;trusted_connection=true”);
        SqlCommand addcmd = new SqlCommand(“AddDept”, deptConnection);
        addcmd.CommandType = CommandType.StoredProcedure;
        deptConnection.Open();
        SqlParameter returnParameter = addcmd.Parameters.Add(“@result”, SqlDbType.Int);
        returnParameter.Direction = ParameterDirection.ReturnValue;
        addcmd.Parameters.AddWithValue(“@DepartmenttName”, DNameTextBox.Text);
        addcmd.Parameters.AddWithValue(“@CountryId”, DLocationDropDownList.SelectedValue);
        addcmd.Parameters.AddWithValue(“@Discription”, DiscriptiomnTextBox.Text);
      
        addcmd.ExecuteNonQuery();
        ResultLabel.Text = addcmd.Parameters[“@result”].Value.ToString();
   
    }
    protected void CancelButton_Click(object sender, EventArgs e)
    {
        Response.Redirect(“Department.aspx”);
    }

    protected void DLocationDropDownList_SelectedIndexChanged(object sender, EventArgs e)
    {

    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using System.Data;

namespace ADODOTNET
{
    class Program
    {
        static void Main(string[] args)
        {
            //SqlConnection northconnection=null;
            //SqlCommand Hellocmd = null;
            //try
            //{
            //    northconnection = new SqlConnection(“Server=LOCALHOST;Database = DAY1;trusted_connection = true”);
            //    Hellocmd = new SqlCommand(“Hello”, northconnection);
            //    Hellocmd.CommandType = CommandType.StoredProcedure;

            //    SqlParameter returnParameter = Hellocmd.Parameters.Add(“@ret”, SqlDbType.Int);
            //    returnParameter.Direction = ParameterDirection.ReturnValue;

            //    northconnection.Open();
            //    int x = Hellocmd.ExecuteNonQuery();         //any reader or scalar , all 3 allowed
            //    Console.WriteLine(Hellocmd.Parameters[“@ret”].Value);
            //}

            //catch (Exception e)
            //{
            //    Console.WriteLine(e.Message);
            //}

            //finally
            //{
            //    northconnection.Close();
            //}

            //……………………………………………………………………………………………
            //……………………………………………………………………………………………

            //SqlConnection northconnection = null;
            //SqlCommand HelloNamecmd;
            //try
            //{
            //    northconnection = new SqlConnection(“Server=LOCALHOST;Database = DAY1;trusted_connection = true”);
            //    HelloNamecmd = new SqlCommand(“HelloName”, northconnection);
            //    HelloNamecmd.CommandType = CommandType.StoredProcedure;

            //    SqlParameter returnParameter = HelloNamecmd.Parameters.Add(“@ret”, SqlDbType.Int);
            //    returnParameter.Direction = ParameterDirection.ReturnValue;
            //    Console.WriteLine(“enter a name”);
            //    String nam = Console.ReadLine();
            //    HelloNamecmd.Parameters.AddWithValue(“@name”,nam);

            //    northconnection.Open();
            //    int x = HelloNamecmd.ExecuteNonQuery();         
            //    Console.WriteLine(HelloNamecmd.Parameters[“@ret”].Value);
            //}

            //catch (Exception e)
            //{
            //    Console.WriteLine(e.Message);
            //}

            //finally
            //{
            //    northconnection.Close();
            //}

            //……………………………………………………………………………………………
            //……………………………………………………………………………………………

            //SqlConnection northconnection = null;
            //SqlCommand HelloNamecmd;
            //try
            //{
            //    northconnection = new SqlConnection(“Server=LOCALHOST;Database = DAY1;trusted_connection = true”);
            //    HelloNamecmd = new SqlCommand(“HelloAge”, northconnection);
            //    HelloNamecmd.CommandType = CommandType.StoredProcedure;

            //    SqlParameter returnParameter = HelloNamecmd.Parameters.Add(“@ret”, SqlDbType.Int);
            //    returnParameter.Direction = ParameterDirection.ReturnValue;
            //    Console.WriteLine(“enter a name”);
            //    String nam = Console.ReadLine();
            //    HelloNamecmd.Parameters.AddWithValue(“@name”, nam);
            //    Console.WriteLine(“enter the age”);
            //    int age = Convert.ToInt32(Console.ReadLine());
            //    HelloNamecmd.Parameters.AddWithValue(“@age”, age);

            //    northconnection.Open();
            //    int x = HelloNamecmd.ExecuteNonQuery();
            //    Console.WriteLine(HelloNamecmd.Parameters[“@ret”].Value);
            //}

            //catch (Exception e)
            //{
            //    Console.WriteLine(e.Message);
            //}

            //finally
            //{
            //    northconnection.Close();
            //}

            //……………………………………………………………………………………………
            //……………………………………………………………………………………………

            //SqlConnection northconnection = null;
            //SqlCommand Empcmd;
            //try
            //{
            //    northconnection = new SqlConnection(“Server=LOCALHOST;Database = DAY1;trusted_connection = true”);
            //    Empcmd = new SqlCommand(“EmployeeDetails”, northconnection);
            //    Empcmd.CommandType = CommandType.StoredProcedure;

            //    Console.WriteLine(“enter employee number”);
            //    String empno = Console.ReadLine();
            //    Empcmd.Parameters.AddWithValue(“@empId”, empno);

            //    northconnection.Open();
            //    SqlDataReader reader = Empcmd.ExecuteReader();

            //    while (reader.Read())
            //    {
            //        Console.WriteLine(reader[0].ToString() + reader[1].ToString() + reader[2].ToString() + reader[3].ToString());
            //    }

            //}

            //catch (Exception e)
            //{
            //    Console.WriteLine(e.Message);
            //}

            //finally
            //{
            //    northconnection.Close();
            //}

            //……………………………………………………………………………………………
            //……………………………………………………………………………………………

            //SqlConnection northconnection = null;
            //SqlCommand Empcmd;
            //try
            //{
            //    northconnection = new SqlConnection(“Server=LOCALHOST;Database = DAY1;trusted_connection = true”);
            //    Empcmd = new SqlCommand(“Empdetail”, northconnection);
            //    Empcmd.CommandType = CommandType.StoredProcedure;

            //    Console.WriteLine(“enter employee number”);
            //    String empno = Console.ReadLine();
            //    Empcmd.Parameters.AddWithValue(“@empId”, empno);

            //    northconnection.Open();
            //    SqlDataReader reader = Empcmd.ExecuteReader();

            //    while (reader.Read())
            //    {
            //        Console.WriteLine(reader[0].ToString() + reader[1].ToString() + reader[2].ToString() + reader[3].ToString());
            //    }

            //}

            //catch (Exception e)
            //{
            //    Console.WriteLine(e.Message);
            //}

            //finally
            //{
            //    northconnection.Close();
            //}

            //……………………………………………………………………………………………
            //……………………………………………………………………………………………

            //SqlConnection northconnection = null;
            //SqlCommand Empcmd;
            //try
            //{
            //    northconnection = new SqlConnection(“Server=LOCALHOST;Database = DAY1;trusted_connection = true”);
            //    Empcmd = new SqlCommand(“AddDept”, northconnection);
            //    Empcmd.CommandType = CommandType.StoredProcedure;

            //    SqlParameter returnParameter = Empcmd.Parameters.Add(“@ret”, SqlDbType.Int);
            //    returnParameter.Direction = ParameterDirection.ReturnValue;

            //    northconnection.Open();
            //    int x=Empcmd.ExecuteNonQuery();
            //    Console.WriteLine(Empcmd.Parameters[“@ret”].Value);

            //}

            //catch (Exception e)
            //{
            //    Console.WriteLine(e.Message);
            //}

            //finally
            //{
            //    northconnection.Close();
            //}

            //……………………………………………………………………………………………
            //……………………………………………………………………………………………

            //SqlConnection northconnection = null;
            //SqlCommand Empcmd;
            //try
            //{
            //    northconnection = new SqlConnection(“Server=LOCALHOST;Database = DAY1;trusted_connection = true”);
            //    Empcmd = new SqlCommand(“ModifyEmployee”, northconnection);
            //    Empcmd.CommandType = CommandType.StoredProcedure;

            //    SqlParameter returnParameter = Empcmd.Parameters.Add(“@ret”, SqlDbType.Int);
            //    returnParameter.Direction = ParameterDirection.ReturnValue;
            //    Console.WriteLine(“enter the employee id whose name need to change”);
            //    int employeeid = Convert.ToInt32(Console.ReadLine());
            //    Empcmd.Parameters.AddWithValue(“@empId”, employeeid);

            //    Console.WriteLine(“enter the name you want to enter”);
            //    String nam = Console.ReadLine();
            //    Empcmd.Parameters.AddWithValue(“@fname”, nam);

            //    northconnection.Open();
            //    int x = Empcmd.ExecuteNonQuery();
            //    Console.WriteLine(Empcmd.Parameters[“@ret”].Value);

            //}

            //catch (Exception e)
            //{
            //    Console.WriteLine(e.Message);
            //}

            //finally
            //{
            //    northconnection.Close();
            //}

            //……………………………………………………………………………………………
            //……………………………………………………………………………………………

            //SqlConnection northconnection = null;
            //SqlCommand Empcmd;
            //try
            //{
            //    northconnection = new SqlConnection(“Server=LOCALHOST;Database = DAY1;trusted_connection = true”);
            //    Empcmd = new SqlCommand(“RemoveEmployee”, northconnection);
            //    Empcmd.CommandType = CommandType.StoredProcedure;

            //    SqlParameter returnParameter = Empcmd.Parameters.Add(“@ret”, SqlDbType.Int);
            //    returnParameter.Direction = ParameterDirection.ReturnValue;
            //    Console.WriteLine(“enter the employee id whose record need to be deleted”);
            //    int employeeid = Convert.ToInt32(Console.ReadLine());
            //    Empcmd.Parameters.AddWithValue(“@empId”, employeeid);

            //    northconnection.Open();
            //    int x = Empcmd.ExecuteNonQuery();
            //    Console.WriteLine(Empcmd.Parameters[“@ret”].Value);

            //}

            //catch (Exception e)
            //{
            //    Console.WriteLine(e.Message);
            //}

            //finally
            //{
            //    northconnection.Close();
            //}
            //……………………………………………………………………………………………
            //……………………………………………………………………………………………

            //SqlConnection northconnection = null;
            //SqlCommand Empcmd;
            //try
            //{
            //    northconnection = new SqlConnection(“Server=LOCALHOST;Database = DAY1;trusted_connection = true”);
            //    Empcmd = new SqlCommand(“Select * from Employee”, northconnection);

            //    northconnection.Open();
            //    SqlDataReader reader = Empcmd.ExecuteReader();

            //    while (reader.Read())
            //    {
            //        Console.WriteLine(reader[0].ToString() + reader[1].ToString() + reader[2].ToString() + reader[3].ToString());
            //    }

            //}

            //catch (Exception e)
            //{
            //    Console.WriteLine(e.Message);
            //}

            //finally
            //{
            //    northconnection.Close();

            //}
            //……………………………………………………………………………………………
            //……………………………………………………………………………………………

            //SqlConnection northconnection = null;
            //SqlCommand Empcmd;
            //try
            //{
            //    northconnection = new SqlConnection(“Server=LOCALHOST;Database = DAY1;trusted_connection = true”);
            //    Empcmd = new SqlCommand(“insert into Employee values (”  , northconnection);

            //    SqlParameter returnParameter = Empcmd.Parameters.Add(“@ret”, SqlDbType.Int);
            //    returnParameter.Direction = ParameterDirection.ReturnValue;

            //    northconnection.Open();
            //    int x = Empcmd.ExecuteNonQuery();
            //    Console.WriteLine(Empcmd.Parameters[“@ret”].Value);

            //}

            //catch (Exception e)
            //{
            //    Console.WriteLine(e.Message);
            //}

            //finally
            //{
            //    northconnection.Close();
            //}

            //Disconnected starts here……………………………………………………………

            //SqlConnection northconnection = null;
            //SqlDataAdapter empadapdter = null;

            //try
            //{
            //    northconnection = new SqlConnection(“Server=LOCALHOST;Database = DAY1;trusted_connection = true”);
            //    empadapdter = new SqlDataAdapter(“select * from Employee”, northconnection);
            //    DataSet ds = new DataSet();
            //    empadapdter.Fill(ds, “Employeenew”); // any name that be in cache

            //    foreach (DataColumn Column in ds.Tables[0].Columns)
            //    {
            //        Console.Write(Column.ColumnName);
            //    }

            //    foreach (DataRow Row in ds.Tables[0].Rows)
            //    {
            //        Console.WriteLine(Row[0].ToString() + Row[1].ToString() + Row[2].ToString() + Row[3].ToString());
            //    }

            //}

            //catch (Exception e)
            //{
            //    Console.WriteLine(e.Message);
            //}

            //……………………………………………………………………………
            //……………………………………………………………………………

            //SqlConnection northconnection = null;
            //SqlDataAdapter empadapdter = null;

            //try
            //{
            //    northconnection = new SqlConnection(“Server=LOCALHOST;Database = DAY1;trusted_connection = true”);
            //    empadapdter = new SqlDataAdapter(“select * from Employee”, northconnection);
            //    DataSet ds = new DataSet();
            //    empadapdter.Fill(ds, “Employeenew”); // any name that be in cache
            //    SqlCommandBuilder builder = new SqlCommandBuilder(empadapdter);

            //    Console.WriteLine(“enter the first name that u want to update”);
            //    String name = Console.ReadLine();

            //    Console.WriteLine(ds.Tables[0].Rows[2][“emp_fname”]= name);

            //    foreach (DataColumn Column in ds.Tables[0].Columns)
            //    {
            //        Console.Write(Column.ColumnName);
            //    }

            //    foreach (DataRow Row in ds.Tables[0].Rows)
            //    {
            //        Console.WriteLine(Row[0].ToString() + Row[1].ToString() + Row[2].ToString() + Row[3].ToString());
            //    }

            //    empadapdter.Update(ds, “Employeenew”);

            //}

            //catch (Exception e)
            //{
            //    Console.WriteLine(e.Message);
            //}

            //……………………………………………………………………………
            //…………………………..prog 3………………………………

            //SqlConnection northconnection = null;
            //SqlDataAdapter empadapdter = null;

            //try
            //{
            //    northconnection = new SqlConnection(“Server=LOCALHOST;Database = DAY1;trusted_connection = true”);
            //    empadapdter = new SqlDataAdapter(“select * from Employee”, northconnection);
            //    DataSet ds = new DataSet();
            //    empadapdter.Fill(ds, “Employeenew”); // any name that be in cache
                

            //    foreach (DataColumn Column in ds.Tables[0].Columns)
            //    {
            //        Console.Write(Column.ColumnName);
            //    }

            //    foreach (DataRow Row in ds.Tables[0].Rows)
            //    {
            //        if (Row[3].ToString() == “d3”)
            //        {
            //            Row[1] = Row[1].ToString() + Row[3].ToString();
            //        }

            //        Console.WriteLine(Row[0].ToString() + Row[1].ToString() + Row[2].ToString() + Row[3].ToString());
            //    }

                

            //}

            //catch (Exception e)
            //{
            //    Console.WriteLine(e.Message);
            //}

            //……………………………………………………………………………
            //…………………………..CALLING A PROCEDURE………………………………

            SqlConnection northconnection = null;
            SqlDataAdapter empadapdter = null;
            SqlCommand Empcmd = null;

            try
            {
                northconnection = new SqlConnection(“Server=LOCALHOST;Database = DAY1;trusted_connection = true”);
                empadapdter = new SqlDataAdapter(“select * from Department”, northconnection);
                Empcmd = new SqlCommand(“AddDept”, northconnection);
                Empcmd.CommandType = CommandType.StoredProcedure;

                DataSet ds = new DataSet();
                empadapdter.Fill(ds, “Employeenew”);
                SqlCommandBuilder builder = new SqlCommandBuilder(empadapdter);

                foreach (DataColumn Column in ds.Tables[0].Columns)
                {
                    Console.Write(Column.ColumnName);
                }

                foreach (DataRow Row in ds.Tables[0].Rows)
                {
                    Console.WriteLine(Row[0].ToString() + Row[1].ToString() + Row[2].ToString());
                }

                empadapdter.Update(ds, “Employeenew”);
            }

            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }

        }
    }

}

Gangnam style facebook chat code smiley


Copy and paste in facebook chat box :

[[534189913290846]] [[534189889957515]] [[534189896624181]]
[[534189893290848]] [[534189906624180]] [[534190003290837]]
[[534190006624170]] [[534190016624169]] [[534189999957504]]
[[534190009957503]] [[534190159957488]] [[534190183290819]]
[[534190176624153]] [[534190179957486]] [[534190163290821]]
[[534190319957472]] [[534190309957473]] [[534190306624140]]
[[534190323290805]] [[534190313290806]] [[534190559957448]]
[[534190566624114]] [[534190556624115]]

Do comment which smiley you want next!!!