Search This Blog

Thursday 29 June 2017

implement Caesar cipher encryption - decryption

Practical - 1





input :
CRYPTOGRAPHy ABC

ABC

Key : 3

output :
Cipher: FUBSWRJUDSKb DEF

DEF



Tuesday 27 June 2017

Thursday 9 February 2017

insert,update,delete search,display in ADO .net Example !

Check out video :



Check other videos to know from starting how to connect and all other things we have to do in VS !


code :

first of all make table in sql server find in my channel !

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace Adoinsert
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        private SqlConnection connection;
        private SqlCommand cmd;
        string con = "Data Source=KANU\\SQLEXPRESS;Initial Catalog=Gajjar;Integrated Security=True";

        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                //open connection and execute query in all the method !!
                connection = new SqlConnection(con);
                connection.Open();
                string sql = "insert into student values('" + textBox1.Text + "','" + textBox2.Text + "')";
                cmd = new SqlCommand(sql, connection);
                cmd.ExecuteNonQuery();
                MessageBox.Show("Record inserted !");
                display();
                //check my simple insert video to get this from begin !!


            }
            catch (Exception ex)
            {
                MessageBox.Show(Convert.ToString(ex));
            }
            finally {
                connection.Close();
            }
        }

        private void btndel_Click(object sender, EventArgs e)
        {
            try
            {
                if (textBox1.Text == "")
                {
                    MessageBox.Show("plz enter id of name to delete !");
                }
                else
                {

                    connection = new SqlConnection();
                    connection.ConnectionString = con;
                    connection.Open();
                    string sql = "delete from student where id = '"+textBox1.Text+"'";
                    cmd = new SqlCommand(sql, connection);
                    cmd.ExecuteNonQuery();
                    MessageBox.Show("Record deleted !");
                    display();
                    //this will be same only we have to query according to our requirement !!

                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(Convert.ToString(ex));
            }
            finally
            {
                connection.Close();
            }
        }

        private void btndisp_Click(object sender, EventArgs e)
        {
            display();
        }

        private void btnsearch_Click(object sender, EventArgs e)
        {
            try
            {
                if (textBox2.Text == "") {
                    MessageBox.Show("plz enter name to search");
                }
                else
                {
                    connection = new SqlConnection();
                    connection.ConnectionString = con;
                    connection.Open();
                    string sql = "select * from student where name = '" + textBox2.Text + "' ";
                    SqlDataAdapter adapter = new SqlDataAdapter(sql, connection);
                    DataSet ds = new DataSet();
                    adapter.Fill(ds);
                    dataGridView1.DataSource = ds;
                    dataGridView1.DataMember = ds.Tables[0].ToString();
                    //this is how we fill the dataGridView :)
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(Convert.ToString(ex));
            }
            finally
            {
                connection.Close();
            }
        }

        private void btnup_Click(object sender, EventArgs e)
        {
            try
            {
                if (textBox1.Text == "" || textBox2.Text=="")
                {
                    MessageBox.Show("plz enter id of old and new name in feilds");
                }
                else
                {
                   
                    connection = new SqlConnection();
                    connection.ConnectionString = con;
                    connection.Open();
                    string sql = "update student set name ='"+textBox2.Text+"' where id = '"+textBox1.Text+"' ";
                    cmd = new SqlCommand(sql, connection);
                    cmd.ExecuteNonQuery();
                    MessageBox.Show("Record updated !");
                    display();

                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(Convert.ToString(ex));
            }
            finally
            {
                connection.Close();
            }
        }
        void display() {
            try
            {
                connection = new SqlConnection();
                connection.ConnectionString = con;
                connection.Open();
                string sql = "select * from student";
                SqlDataAdapter adapter = new SqlDataAdapter(sql, connection);
                DataSet ds = new DataSet();
                adapter.Fill(ds);
                dataGridView1.DataSource = ds;
                dataGridView1.DataMember = ds.Tables[0].ToString();
                //this is how we get datasource and we assign it to datagridview!!
            }
            catch (Exception ex)
            {
                MessageBox.Show(Convert.ToString(ex));
            }
            finally
            {
                connection.Close();
            }
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            display();
        }
    }
}



Monday 6 February 2017

Implement TCP Server for transferring files using Socket and ServerSocket .

Practical - 2 B

find source code : labels->6th sem->Link-> All Programs

Output :
Sending File ...
File Recieved !

Develop chat application using either TCP or UDP protocol.

Practical 2 - A




Output :

run:
Client : Hi,This is Karan Gajjar
Server : Hello Gajjar
Client : Ok Bye
Server : Type END To Close Connection
BUILD SUCCESSFUL (total time: 46 seconds)

run:
Client : Hi,This is Karan Gajjar
Server : Hello Gajjar
Client : Ok Bye
Server : Type END To Close Connection
Client : END
Server : BYE
BUILD SUCCESSFUL (total time: 43 seconds)

Write a program to implement the connectionless echo client server application.

Practical 1 - B





Output:

Client Connected :
RECEIVED: Hi This is Gajjar

Enter :
Hi This is Gajjar
FROM SERVER:Hi This is Gajjar

Write a program to implement the connection oriented echo client server application.

Practical - 1 (A)

YouTube -




Output:

Connected
Message Received From Client : Hi This is Karan Gajjar


 Server Socket Connected.
 Enter the Message : Hi This is Karan Gajjar
 Message Send Successfully.
 Message From Server : Hi This is Karan Gajjar

custom control in windows form

Practical 2 - 7





Sunday 5 February 2017

Implement an MDI form with Menu item “Add”, clicking on Add generates a new child form. And Menu Child Forms which implement Error Provider, Panel and Group Box.

Practical  2-6



Create a Window Form Person with data members: name, birthdate. Create a Window Form Employee that inherits from Form Person with members: hire date, salary. Display all the members on the Form Employee. Use Get & Set Property methods.

Practical 2 - 5



Create a windows form which implements Menus (File, Color). File menu item has 4 options Font, Open, Save, Print (Print Preview and Print), Exit. Color menu item has 3 options Red, Green, Blue. Clicking on the file menu items opens the respective dialog boxes and implements the functionality. Clicking on the colors sets the background of the form with respective color. Also provide a Context Menu of your choice.

Practical 2 - 4


Create a formtodemonstrateuse ofmethods and properties of listbox. Demonstrate Drag & Drop between 2 list boxes.

Practical 2 - 3





Create form to demonstrate use of structured exception handling.

Practical 2 - 2


WAP to display Welcome to SCET in message box when you click on SCET button. B. WAP to accept your name in textbox and display it using message box. C. WAP to accept your Name, City in text box and display it in label when you click on Display button. Add two more buttons Clear & Close and implement accordingly.

Practical 2 - A

Form1.cs

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Prac21
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        private void button1_Click(object sender, EventArgs e)
        {
             MessageBox.Show("HI This is Gajjar");
        }

    }
}
Form2.cs

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Prac21
{
    public partial class Form2 : Form
    {
        public Form2()
        {
            InitializeComponent();
        }
        private void button1_Click(object sender, EventArgs e)
        {
            MessageBox.Show("Hi, " + textBox1.Text);
        }
    }
}

Form3.cs

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Prac21
{
    public partial class Form3 : Form
    {
        public Form3()
        {
            InitializeComponent();
        }
        private void btndisplay_Click(object sender, EventArgs e)
        {
            if (txtname.Text.Equals("") || txtcity.Text.Equals(""))
            {
                MessageBox.Show("Plz Enter All Details");
            }
            else {
                lblname.Text = txtname.Text;
                lblcity.Text = txtcity.Text;
            }
        }
        private void btnclear_Click(object sender, EventArgs e)
        {
            lblcity.Text = "";
            lblname.Text = "";
            txtcity.Text = "";
            txtname.Text = "";
        }
        private void btnclose_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }
    }
}

Thursday 2 February 2017

Develop an user interface that perform the following SQL operations :  (i) Select          (ii) Insert          (iii) Update            (iv) Delete

Practical - 4B




output:
run:
Thu Feb 02 00:11:39 IST 2017
Enter Your Choice :
1.Select
2.Insert
3.Update
4.Delete
5.Exit:
1
ID: 1, Name: karan
ID: 2, Name: vatsal
ID: 3, Name: jay
ID: 4, Name: s4
ID: 5, Name: s5
Enter Your Choice :
1.Select
2.Insert
3.Update
4.Delete
5.Exit:
2
Enter Id :
6
Enter Name :
gajjar
Inserted records into the table...
Enter Your Choice :
1.Select
2.Insert
3.Update
4.Delete
5.Exit:
1
ID: 1, Name: karan
ID: 2, Name: vatsal
ID: 3, Name: jay
ID: 4, Name: s4
ID: 5, Name: s5
ID: 6, Name: gajjar
Enter Your Choice :
1.Select
2.Insert
3.Update
4.Delete
5.Exit:
3
Enter Id to update :
5
Enter new name :
newname5
Enter Your Choice :
1.Select
2.Insert
3.Update
4.Delete
5.Exit:
1
ID: 1, Name: karan
ID: 2, Name: vatsal
ID: 3, Name: jay
ID: 4, Name: s4
ID: 5, Name: newname5
ID: 6, Name: gajjar
Enter Your Choice :
1.Select
2.Insert
3.Update
4.Delete
5.Exit:
4
Enter Id to delete :
5
Enter Your Choice :
1.Select
2.Insert
3.Update
4.Delete
5.Exit:
1
ID: 1, Name: karan
ID: 2, Name: vatsal
ID: 3, Name: jay
ID: 4, Name: s4
ID: 6, Name: gajjar
1.Select
2.Insert
3.Update
4.Delete
5.Exit:
1
ID: 1, Name: karan
ID: 2, Name: vatsal
ID: 3, Name: jay
ID: 4, Name: s4
ID: 6, Name: gajjar
Enter Your Choice :
1.Select
2.Insert
3.Update
4.Delete
5.Exit:
4
Enter Id to delete :
5
error !
Enter Your Choice :
1.Select
2.Insert
3.Update
4.Delete
5.Exit:
1
ID: 1, Name: karan
ID: 2, Name: vatsal
ID: 3, Name: jay
ID: 4, Name: s4
ID: 6, Name: gajjar
Enter Your Choice :
1.Select
2.Insert
3.Update
4.Delete
5.Exit:
3
Enter Id to update :
5
Enter new name :
kkk
error !
Enter Your Choice :
1.Select
2.Insert
3.Update
4.Delete
5.Exit:5

Tuesday 31 January 2017

All Practical List , Books , And Materials

find practical list,
Programs,
Books..

Download - Click Here

Time Table using html

Write a javascript program to demo alert box,conditional box and prompt box.

JS Prac 3

<html>
    <head>
    <title>Practicle 1 JS</title>
    <script>
        function myf(){
            alert("This is an alert box");
            }
           
        function mycon(){
            var x;
            if(confirm("Press Any")==true){
                alert("You Clicked Ok !");
            }else{
                alert("You Clicked Cancel !");
            }
        }
        function myprompt(){
            var name = prompt("Enter your name");
           
            if(name){
                alert("You Entered "+name);
            }else if(name==""){
                alert("msg empty");
            }else{
                alert("you canceled");
                }
        }
    </script>
    </head>
    <body>
    <button onclick="myf()">Alert</button><br/>
    <button onclick="mycon()">Confirm</button><br>
    <button onclick="myprompt()">Prompt</button>

    </body>
    </html>

Write a javascript program to demo of local and global variables.

JS Prac - 2

<html>

<head>
    <script>
    lname = "Gajjar"; //global
    </script>
</head>

<body>
<pre>
1. A variable that is declared inside a function using the var keyword, will have a local scope.
2. A variable that is declared inside a function without var keyword, will have a global scope means acts like a global variable.
</pre>

<script>
var fname = "Karan"; //global
myFunction();

function myFunction() {
    var h = "hello"; //local
    document.write(h+" "+fname+" "+lname);
}
</script>
</body>
</html>

Write a javascript program to display “hello world” using internal javascript and external javascript.

Practical - 1

Internal JavaScript -

prac1.html

<html>
    <head>
    <title>Practicle 1 JS</title>
    <script>
        document.write("Hi this is karan Gajjar");
    </script>
    </head>
    </html>

------------------------------------------------------------------------------------------------

External JavaScript -

pract1(2).html

<html>
    <head>
    <title>Practicle 1 JS</title>
    <script src = "prac1.js">
    </script>
    </head>
    </html>

prac1.js

var str = "Karan Gajjar - Android Developer";
var result = str.link("https://goo.gl/gmzl4t");
document.write(result);