Wednesday, 1 May 2013

How to make mobile easy load simple software C#

How to make mobile easy load simple software C#





How to make mobile easy load simple software C#


How to make mobile easy load simple software C#


How to make mobile easy load simple software C#



How to make mobile easy load simple software C#



How to make mobile easy load simple software C#





Code

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.Text.RegularExpressions;
using System.Data.SqlClient;

namespace easyloadreg2012
{
    public partial class Delete : Form
    {
        public Delete()
        {
            InitializeComponent();
        }

        private void exitToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Regex MobileNo = new Regex("[0-9]{11}");
            bool a = MobileNo.IsMatch(textBox1.Text);
            if (a == true)
            {
                this.GetEasySearchList(textBox1.Text.ToString());
                MessageBox.Show("Deleted");
            }
            else
            {
                MessageBox.Show("Enter Correct Mobile No");
            }
        }
        void  GetEasySearchList(string MobileNo)
        {
            string connectionString = @"Data Source=ASSAD;Initial Catalog=EasyLoadDB;Integrated Security=True;Connect Timeout=15;Encrypt=False;TrustServerCertificate=False";

            using (SqlConnection con = new SqlConnection(connectionString))
            {
                using (SqlCommand command = new SqlCommand())
                {
                    command.CommandText = string.Format(@"delete from EasyLoad where MobileNumber='{0}' ", MobileNo);
                    command.Connection = con;
                    con.Open();
                    SqlDataReader sqlDataReader = command.ExecuteReader();
                    con.Close();
                }
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void Delete_Load(object sender, EventArgs e)
        {

        }
    }
}








1 comment: