Tuesday, May 21, 2013

private void dataGridView1_CellContentClick_1(object sender, DataGridViewCellEventArgs e)
        {

            DataGridViewRow row = this.dataGridView1.Rows[e.RowIndex];
            textBox1.Text = row.Cells[0].Value.ToString();

databinding

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace lab12_1
{
    public partial class Form1 : Form
    {
         SqlConnection con=new SqlConnection("Data Source=TANISH;Initial Catalog=department;User ID=sa;Password=seed");

         SqlDataAdapter da;
         DataSet ds = new DataSet();
       
        
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            SqlDataAdapter sqlda = new SqlDataAdapter("insert into dept1 values("+textBox1.Text+",'"+textBox2.Text+"')", con);
            //da = new SqlDataAdapter("select * from dept1", con);
            //SqlCommandBuilder cmdBuilder = new SqlCommandBuilder(sqlda);
         //   DataSet ds = new DataSet();

            sqlda.Fill(ds,"dept1");
           
            dataGridView1.DataSource = ds.Tables[0];
           
           
        }

        private void button5_Click(object sender, EventArgs e)
        {
            da = new SqlDataAdapter("select * from dept1", con);
            da.Fill(ds);
           // dataGridView1.Refresh();
            dataGridView1.DataSource = ds.Tables[0];
           
        }

        private void button3_Click(object sender, EventArgs e)
        {
            SqlDataAdapter sqlda = new SqlDataAdapter("Update dept1 set name='"+textBox2.Text+"' where id="+textBox1.Text+"", con);
            //da = new SqlDataAdapter("select * from dept1", con);
            //SqlCommandBuilder cmdBuilder = new SqlCommandBuilder(sqlda);
            //   DataSet ds = new DataSet();

            sqlda.Fill(ds, "dept1");

            dataGridView1.DataSource = ds.Tables[0];
        }

        private void button4_Click(object sender, EventArgs e)
        {

            SqlDataAdapter sqlda = new SqlDataAdapter("delete from dept1 where id="+textBox1.Text+"" , con);
            //da = new SqlDataAdapter("select * from dept1", con);
            //SqlCommandBuilder cmdBuilder = new SqlCommandBuilder(sqlda);
            //   DataSet ds = new DataSet();

            sqlda.Fill(ds, "dept1");

            dataGridView1.DataSource = ds.Tables[0];
        }

        private void button2_Click(object sender, EventArgs e)
        {

        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {
            textBox1.DataBindings.Add("text", ds.Tables[0], "id");
        }

        private void textBox2_TextChanged(object sender, EventArgs e)
        {
            textBox2.DataBindings.Add("text", ds.Tables[0], "name");
        }

        private void button2_Click_1(object sender, EventArgs e)
        {
            BindingContext[ds.Tables[0]].Position = ds.Tables[0].Rows.Count - 1;
        }

        private void button7_Click(object sender, EventArgs e)
        {
            if (BindingContext[ds.Tables[0]].Position < ds.Tables[0].Rows.Count - 1)
                BindingContext[ds.Tables[0]].Position = BindingContext[ds.Tables[0]].Position + 1;
        }

        private void button6_Click(object sender, EventArgs e)
        {
             if(BindingContext[ds.Tables[0]].Position>0)
                BindingContext[ds.Tables[0]].Position=BindingContext[ds.Tables[0]].Position-1;

        }

        private void button8_Click(object sender, EventArgs e)
        {
            BindingContext[ds.Tables[0]].Position = 0;
        }
    }
}

Sunday, May 19, 2013

private void btnDeleteFL_Click(object sender, EventArgs e)

{

    if (MessageBox.Show("Are you sure you want to delete this feature?",

        "Confirm delete", MessageBoxButtons.YesNo) == DialogResult.Yes)

    {

        // Delete the require record according to the user command.              

    }
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace WindowsFormsApplication3
{
    public partial class Form1 : Form
    {
        SqlConnection con = new SqlConnection("Data Source=ARNAV;Initial Catalog=Mrudu;User ID=sa;Password=manager");
        SqlCommand cmd;

        SqlDataReader dr;

        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            con.Open();
           
            cmd = new SqlCommand("insert into Cust values("+textBox1.Text+",'"+textBox2.Text+"')", con);
            int r=cmd.ExecuteNonQuery();
            if (r > 0)
                MessageBox.Show("Row Inserted!!!");
            else
                MessageBox.Show("Insert Data");
           
            con.Close();
            display();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            con.Open();
            cmd=new SqlCommand("delete from Cust where Cust_ID="+textBox1.Text);
            cmd.Connection = con;
            int r = cmd.ExecuteNonQuery();
            if (r > 0)
                MessageBox.Show("Row Deleted!!!");
            else
                MessageBox.Show("Not Deleted");
           
            con.Close();
            display();
        }

        private void button3_Click(object sender, EventArgs e)
        {
            con.Open();
            cmd = new SqlCommand("update Employee set Emp_Name='"+textBox2.Text+"' where Emp_ID ="+textBox1.Text);
            cmd.Connection = con;
            int r = cmd.ExecuteNonQuery();
            if (r > 0)
                MessageBox.Show("Row updated");
            else
                MessageBox.Show("Not updated");
           
            con.Close();
            //display();
        }

        private void button4_Click(object sender, EventArgs e)
        {
            con.Open();
            cmd = new SqlCommand("select count(Cust_ID) from Cust", con);
            int cnt = (int)cmd.ExecuteScalar();
            MessageBox.Show("Total No. of customers : "+cnt.ToString());
           
            con.Close();
        }

        private void button5_Click(object sender, EventArgs e)
        {
            con.Open();
        
            cmd = new SqlCommand("StoredProcedure1", con);
            cmd.CommandType = CommandType.StoredProcedure;

            SqlParameter param = new SqlParameter();
            param.ParameterName = "@cno";
            param.Value = textBox1.Text;
            cmd.Parameters.Add(param);

            dr = cmd.ExecuteReader();

            while (dr.Read())
            {
                MessageBox.Show("ID : " + dr[0].ToString());
                MessageBox.Show("Name : " + dr[1].ToString());
            }
           
            con.Close();
            //display();
        }
        public void display()
        {
            con.Open();
            cmd = new SqlCommand("select * from Cust", con);
            dr = cmd.ExecuteReader();
            DataTable dt = new DataTable();
            dt.Load(dr);
            dataGridView1.DataSource = dt;
            con.Close();

        }

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

        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {

        }

      

       
    }
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace WindowsFormsApplication3
{
    public partial class Form1 : Form
    {
        SqlConnection con = new SqlConnection("Data Source=ARNAV;Initial Catalog=Mrudu;User ID=sa;Password=manager");
        SqlDataAdapter da;
        DataSet ds=new DataSet();
        SqlCommandBuilder cbd;
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
           
            DataRow drow = ds.Tables[0].NewRow();
            drow[0] = textBox1.Text;
            drow[1] = textBox2.Text;
            ds.Tables[0].Rows.Add(drow);
            cbd = new SqlCommandBuilder(da);
            da.Update(ds, "Cust");
            //da = new SqlDataAdapter("insert into Cust values("+textBox1.Text+",'"+textBox2.Text+"')", con);
            //ds = new DataSet();
            //da.Fill(ds, "Cust");
            //MessageBox.Show("Done");
        }

        private void button2_Click(object sender, EventArgs e)
        {
            DataRow dr = ds.Tables["Cust"].NewRow();
            dr = ds.Tables[0].Rows.Find(textBox1.Text);
            dr.Delete();
            cbd = new SqlCommandBuilder(da);
            da.Update(ds, "Cust");
            //da = new SqlDataAdapter("delete from Cust where Cust_ID=" + textBox1.Text, con);
            //ds = new DataSet();
            //da.Fill(ds, "Cust");
            //MessageBox.Show("Deleted");
        }

        private void button3_Click(object sender, EventArgs e)
        {
            DataRow drow = ds.Tables[0].NewRow();
            drow = ds.Tables[0].Rows.Find(textBox1.Text);
            drow[1] = textBox2.Text;
            cbd = new SqlCommandBuilder(da);
            da.Update(ds, "Cust");
            //da = new SqlDataAdapter("update Cust set Cust_Name='" + textBox2.Text + "' where Cust_ID=" + textBox1.Text, con);
            //ds = new DataSet();
            //da.Fill(ds, "Cust");
            //MessageBox.Show("Updated");
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            da = new SqlDataAdapter("Select * from Cust", con);
            da.MissingSchemaAction = MissingSchemaAction.AddWithKey;
            da.Fill(ds, "Cust");

            dataGridView1.DataSource = ds.Tables[0];
        }

     
    }
}

Tuesday, January 5, 2010

HAVE A LOOK AT HTC HERO



# General Features
2G Network - GSM 850 / 900 / 1800 / 1900
3G Network - HSDPA 900 / 2100
Dimensions - 112 x 56.2 x 14.4 mm
Weight - 135 g
# Display
Type - TFT capacitive touchscreen, 65K colors
Size - 320 x 480 pixels, 3.2 inches
Others - Sense UI , Multi-touch input method, Accelerometer sensor for auto-rotate, Trackball
#Sound
Alert types-Vibration; Downloadable polyphonic, MP3, WAV ringtones
Speakerphone-Yes; 3.5 mm audio jack
#Memory
Phonebook-Practically unlimited entries and fields, Photocall
Call records-Practically unlimited
Internal288 -MB RAM, 512 MB ROM
Card slot -microSD
#Data
GPRS -Class 10 (4+1/3+2 slots), 32 - 48 kbps
EDGE -Class 10, 236.8 kbps
3G-HSDPA, 7.2 Mbps; HSUPA, 2.0 Mbps
WLAN-Wi-Fi 802.11 b/g
Bluetooth-Yes v2.0 with A2DP
Infrared port-No
USB-Yes, miniUSB
#Camera
Primary-5 MP, 2592 x 1944 pixels, autofocus
Features-Touch focus (via software update)
Video-Yes,
CIF@15fps
#OS
Android OS, v1.5 (Cupcake)
#CPU
Qualcomm MSM 7200A 528 MHz processor
#Messaging
SMS(threaded view), MMS, Email, Instant Messaging
#Browser
HTML
#Radio
No
#Games
Yes
#Colors
Brown, White (teflon coating), Graphite, Black, Pink
#GPS
Yes, with A-GPS support
#Java
Via third party application
#Others
Digital compass
Dedicated search key
Scenes quick profile switcher
MP3/AAC+/WAV/WMA9 player
MP4/H.263/H.264/WMV9 player
Voice memo
#Battery
Standard battery, Li-Ion 1350 mAh
Stand-by-Up to 440 h (2G) / Up to 750 h (3G)
Talk time-Up to 8 h (2G) / Up to 7 h (3G)

Sunday, August 30, 2009

Sony India launches DSC-TX1 and DSX-WX1 low-light cameras with HD video

#Stable Exmor R back-illuminated CMOS sensor technology.
#Amazingly clear, vibrant photos in low lighting scenarios.
#Wires and other circuit elements are positioned behind the photo-diodes so that Exmor R image sensors can gather more light, resulting in approximately twice the sensitivity compared to conventional sensors.
#To further extend low-light shooting performance, the TX1 and WX1 cameras incorporate the hand-held twilight and anti-motion blur multi-shot modes that capture six separate images in less than a second and utilise Sony’s BIONZ processor to combine the shots into a single image of extraordinary detail.
#Includes Sweep Panorama and 10 frames per second burst shooting features, in smaller, more compact bodies that match nearly any unique style.
#Capturing wide landscapes is as easy as "press and sweep." The BIONZ imaging processor automatically stitches the pictures together to create one stunning panoramic photo.
#With HD video capability, these can record HD movies in 720p high definition MPEG4 format for stunning large-screen home movie playback and record up to 29 minutes (or up to 2GB file size) in 720p format.
#Slim profile of just 16.5mm, the fashionable 10.2-megapixel TX1 features a new operation on the touch panel that lets you scroll through images with a flick of your finger and directly access menus on the 3-inch Clear Photo LCD Plus display.
#Carl Zeiss Vario-Tessar lens, the TX1 camera lets you focus as little as 0.4 inches from your subject for extraordinary close-up shots.
# 4x telescopic zoom perfect for capturing far-away subjects, and Sony’s Optical SteadyShot image stabilisation helps overcome camera shake.
#10.2 mega-pixel WX1 camera has a 2.7-inch Clear Photo LCD Plus display and is just over three quarters of an inch thin – an ideal choice for DSLR owners who also want to carry a compact, high performance digital still camera.
#WX1 camera features a Sony G lens with an extraordinary wide angle 24-120mm 5x optical zoom which offers nearly twice the light gathering capability of conventional lenses, and works together with the Exmor R sensor and low-light shooting modes to provide low-light photography beyond the abilities of other compact cameras.
#Includes all the next-gen software technology that Sony cameras are famous for, such as intelligent auto mode, face detection, scene selection, red-eye removal, anti-blur, smile shutter, etc.