Friday, 25 May 2012

When the World Will be Ended

It is a very intersting sentence asked and also think by most of the people that when the world will be end.
some says the dooms day will be soon and some says it is too far, many religions of the world also focus this thing including Islam ,Christianity ,Jodhism ,Budhism ,Hinduism etc and in many religious books of the big religions of the world also talked about this and gave number of predictions on that day,,

Well! in this era in which we are living it is the era of technology , where the human have been reached on the Mars , Moon etc we have created the robots ,computers small device,Atom bombs and many other mass destruction weapons through which we can terrify the world and can also save the world,,, we blive that the day when the world will be end its too far away from us approximately after billions of years when the earth will totaly be freezed and emmited out total energy from it,,because according to the scientists the earth is continuousely releasing its energy and going away from sun and when it totaly lost its energy at that day it will be gone away from that sun and that day will be the dooms day or ending day of the earth..


if you like this intresting post then please subscribe us and post your comments...

Thanks

when will be world end


Wednesday, 23 May 2012

Young Enterprenures Of NED University Of Engineering & Technology Karachi Launched their Software House in Karachi Pakistan



banner


A New Software House is going to be launched soon By the young Enterprenure of NED University Of Engineering And Technology Karachi

Mr Adnan Naseer Sheikh and Mr.Aoun Ali Naqvi are Young Enterprenure,They have decided to provide the Simple Software Solution through tough tecnologies and platforms like dontnet or other Open source plateforms. the software house also provides the oppertunity to the young students of different universities that they can join and develop the most challenging mobile and web based applications and can sale there softwares through the third party services that is provided by "LOGIXTICS".

It will be benificial for the students to create their own jobs ,generate their own revenue which is the better approach for creating the jobs in Pakistan ,"LOGIXTICS " also provides the chance for the part time workers to develop apps at their home and sale to it to Logixtics on a suitable package or price.

Our Official Social Network page on Facebook is following

https://www.facebook.com/Logixtics 

Our Official Website is going to be launched soon

We need your Support and prayers and best wishes

Thanks

Please Subscribe us .

Monday, 21 May 2012

Data Exporting to MS-Excel in Webmatrix


Hey Guys! I 've researched on new topic ..
This solution uses the System.Data.SqlServerCe.dll, should be referenced in Web.config file, and also three more functions

Here in Web.config file you should write this code

<?xml version="1.0"?>
<configuration>
  <system.web>
    <compilation debug="true">
      <assemblies>
        <add assembly="System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91"/>
      </assemblies>
    </compilation>
  </system.web>
</configuration>
There is an add assembly setting that references the System.Data.SqlServerCe.dll assembly which is needed during the compilation of the web page eg: for further you should see CreateDataTable function.

Here the CreateDataTable function
public static DataTable CreateDataTable(string sqlCeDb, string sqlCmd)
{
    DataSet dataSet = new DataSet();
    DataTable dt = new DataTable();
   
    try {
        SqlCeConnection sqlConn= new SqlCeConnection();
        sqlConn.ConnectionString = "Data Source = " + sqlCeDb;

        SqlCeCommand cmd = new SqlCeCommand();
        cmd.CommandType = CommandType.Text;
        cmd.CommandText = sqlCmd;
        cmd.Connection = sqlConn;

        sqlConn.Open();
        SqlCeDataAdapter sda = new SqlCeDataAdapter(cmd);
   
        sda.Fill(dataSet);
        sqlConn.Close();
       
        dt = dataSet.Tables[0];
        return dt;
    }
    catch (Exception ex)
    {
        return dt;
    }     
}


This CreateDataTable function opens a connection with the SQL Server CE database and exports data as DataTable from the database.
It accepts the physical path of the SQL Server CE .sdf file as first parameter and the SQL query extracting data from the database as second parameter.
The function instantiates classes from the System.Data.SqlServerCe namespace, that must be referenced in   Web.Config.

Here the ExportToExcel function
public static int ExportToExcel(DataTable dt, string excelFile, string sheetName)
{
    // Create the connection string
    string connString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" +
        excelFile + ";Extended Properties=Excel 12.0 Xml;";
   
    int rNumb = 0;
    try
    {
        using (OleDbConnection con = new OleDbConnection(connString))
        {
            con.Open();
           
            // Build the field names string
            StringBuilder strField = new StringBuilder();
            for (int i = 0; i < dt.Columns.Count; i++)
            {
                strField.Append("[" + dt.Columns[i].ColumnName + "],");
            }
            strField = strField.Remove(strField.Length - 1, 1);
           
            // Create Excel sheet
            var sqlCmd = "CREATE TABLE [" + sheetName + "] (" + strField.ToString().Replace("]", "] text") + ")";
            OleDbCommand cmd = new OleDbCommand(sqlCmd, con);
            cmd.ExecuteNonQuery();

            for (int i = 0; i < dt.Rows.Count; i++)
            {
               
                // Insert data into Excel sheet
                StringBuilder strValue = new StringBuilder();
                for (int j = 0; j < dt.Columns.Count; j++)
                {
                    strValue.Append("'" + AddSingleQuotes(dt.Rows[i][j].ToString()) + "',");
                }
                strValue = strValue.Remove(strValue.Length - 1, 1);
                
                cmd.CommandText = "INSERT INTO [" + sheetName + "] (" + strField.ToString() + ") VALUES (" +
                        strValue.ToString() + ")";
                cmd.ExecuteNonQuery();
                rNumb = i + 1;
            }
            con.Close();
        }
        return rNumb;
    }
    catch (Exception ex)
    {
        return -1;
    }
}

The ExportToExcel function receives a DataTable as first parameter and transfers its content into a sheet (with name from the third parameter) of a new Excel file created at the path passed with the second parameter.
If the function is successful, it returns the number of exported records, otherwise it returns -1.
It derives with some modifications from the Export function from Exporting Data to Excel; in the following I highlight its points of interest.

The connection string
I have chosen to produce an Excel file in the new .xlsx file format introduced by Excel 2007, and so I have used a connection string to the Access Database Engine 2010, which exists in 32-bit and 64-bit versions and that must be downloaded from Microsoft Access Database Engine 2010 Redistributable, if it’s not present on your system yet.
Even if you want to create a traditional .xls file, you have to know that the old Microsoft OLE DB Provider for Jet is available in 32-bit version only.
So, the only solution for the web sites running on 64-bit environments is to use the Access Database Engine 2010 with a slightly different connection string:
Description: http://www.codeproject.com/images/minus.gif Collapse | Copy Code
string connString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" +
    excelFile + ";Extended Properties=Excel 8.0;";

The field names string
Two different SQL statements require a list of field name as string in the format
Description: http://www.codeproject.com/images/minus.gif Collapse | Copy Code
[field1],[field2],[field3],…,[fieldn]
The string is created by a for loop that appends to a StringBuilder object all the column names of the DataTable.

Create Excel sheet
The major simplification used by the function is that all the data from database are transferred to the Excel file as text.
This approach avoids to examine one by one the column data types of DataTable and create an Excel sheet with columns of the same source type.
So, all the columns of the Excel sheet are generated as text fields with a SQL statement that uses the field names string seen before adding to any field name “text” as data type with the use of a Replace("]", "] text")method.

Copy records from DataTable to Excel sheet
For each DataTable row a string is created appending all the row values and then the string is used together with the field names string to assemble a SQL statement that inserts the row values into the Excel sheet.
Note that the process of creating a field values string involves a call to the AddSingleQuote function to escape possible single quotes in the values.

Add Single Quote function
public static string AddSingleQuotes(string origText)
{
 string s = origText;
    int i = 0;
   
    while ((i = s.IndexOf("'", i)) != -1)
    {
        // Add single quote after existing
        s = s.Substring(0, i) + "'" + s.Substring(i);

        // Increment the index.
        i += 2;
    }
    return s;
}
If the text passed as value to the Insert SQL statement includes a single quote, SQL Server throws an error (Error: 105 Unclosed quotation mark after the character string ‘).
The function fixes this occurrence by escaping any single quote with the addition of a second single quote.

Now the sample application
To illustrate the use of my functions, I propose a simple site that extract data as Excel file from a sample database with a quite complex query.

The sample database I used is the TestDB.sdf file downloadable from the link SQL server compact Edition 4.0
It must be copied into the App_Data directory of the sample site and then Default.cshtml page can be launched in browser.
Obviously, the query I used could be replaced with a simpler one like

SELECT * FROM Customers



Thursday, 17 May 2012

Data Duplication Elimination or BSN(Basic Sorted Neighbourhood) Methods using C# (C-Sharp)


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

namespace ConsoleApplication4
{
    class Program
    {
static void Main(string[] args)
        {
            List<person> persons = new List<person>();
            //database records entring
            person p = new person();
            //1st record
            p.id = 1;
            p.firstName = "Aoun";
            p.lastName = "Ali";
            p.age = 22;
            p.address = "Pakistan, karachi";

            persons.Add(p);

            //2nd record
            p = new person();
            p.id = 2;
            p.firstName = "Marium";
            p.lastName = "Hussain";
            p.age = 22;
            p.address = "Pakistan, Karachi";

            persons.Add(p);

            //3rd record
            p = new person();
            p.id = 3;
            p.firstName = "Osama";
            p.lastName = "Ali";
            p.age = 23;
            p.address = "Pakistan, karachi";

            persons.Add(p);

            //4th record
            p = new person();
            p.id = 4;
            p.firstName = "Ayesha ";
            p.lastName = "Ejaz";
            p.age = 22;
            p.address = "Pakistan, karachi";

            persons.Add(p);

            //5th record
            p = new person();
            p.id = 5;
            p.firstName = "Adnan";
            p.lastName = "Naseer";
            p.age = 23;
            p.address = "Pakistan, karachi";

            persons.Add(p);

            //6th record
            p = new person();
            p.id = 6;
            p.firstName = "Raheel";
            p.lastName = "Malik";
            p.age = 23;
            p.address = "Pakistan, islamabad";

            persons.Add(p);

            //7th record(redundant)
            p = new person();
            p.id = 7;
            p.firstName = "Aoun";
            p.lastName = "Ali";
            p.age = 22;
            p.address = "Pakistan, karachi";

            persons.Add(p);

            //8th record(redundant)
            p = new person();
            p.id = 8;
            p.firstName = "Marium";
            p.lastName = "Hussain";
            p.age = 22;
            p.address = "Pakistan, Karachi";

            persons.Add(p);

            //9th record(redundant)
            p = new person();
            p.id = 9;
            p.firstName = "Ayesha";
            p.lastName = "Ejaz";
            p.age = 23;
            p.address = "Pakistan, karachi";

            persons.Add(p);

            //10th record(redundant)
            p = new person();
            p.id = 10;
            p.firstName = "Osama";
            p.lastName = "Ali";
            p.age = 23;
            p.address = "Pakistan, karachi";

            persons.Add(p);
            //DATABASE END

            //display record
            Console.WriteLine("ID        First_Name       Last_Name       age       Address");
            for(int i=0; i<persons.Count  ; i++)
            {
                Console.WriteLine(persons[i].id + "        " + persons[i].firstName + "             " + persons[i].lastName + "            " + persons[i].age + "             " + persons[i].address);
            }
            Console.WriteLine("\n\n\n\n");


            List<string> key = new List<string>();

            //MAKING KEY BY CONCATENATING THE IMPORTANT COLUMNS ( I CHOOSE FIRST_NAME, AGE, ADDRESS)
            foreach (person pi in persons)
            {
                key.Add(pi.firstName + pi.age.ToString() + pi.address);
            }

            //SORT THE KEY FIRST
            key.Sort();

            //MAKING SORTED LIST ON THE BASIS OF SORTED KEY SO THAT REDUNDANT RECORDS COME NEXT TO EACH OTHER
            List<person> sortedlist = new List<person>();
            for (int i = 0; i < persons.Count; i++)
            {
                foreach (person pi in persons)
                {
                    if (key[i] == (pi.firstName + pi.age.ToString() + pi.address))
                    {
                        sortedlist.Add(pi);
                        break;
                    }
                }
            }

            Console.WriteLine("\n\n\n\n");

            //remove redundant data from sorted list
            for (int i = 0; i < sortedlist.Count - 1; i++)
            {
                string record1 = sortedlist[i].firstName + sortedlist[i].age.ToString() + sortedlist[i].address;
                string record2 = sortedlist[i + 1].firstName + sortedlist[i + 1].age.ToString() + sortedlist[i + 1].address;

                if (record1 == record2)
                    sortedlist.Remove(sortedlist[i]);
            }

            Console.WriteLine("After Applied BSN");
            Console.WriteLine("ID       First_Name      Last_Name     age     Address");
            for (int i = 0; i < sortedlist.Count; i++)
            {
                Console.WriteLine(sortedlist[i].id + "        " + sortedlist[i].firstName + "       " + sortedlist[i].lastName + "     " + persons[i].age + "     " + persons[i].address);
            }
            Console.ReadKey();
        }
    }

    class person
    {
        public int id;
        public string firstName;
        public string lastName;
        public int age;
        public string address;
    }


    }



Output:
Before BSN:

this is input or before bsn





After BSN:





I m also Giving a video reference This is in urdu Language from Virtual university ,Lecture of dataware housing.



Dataware house implementation

text ned university telenor logo dataware house erp enterprises pakistan oracle juniva sims numbers this is the blog tech labs news updates djuice
ned university logo dataware house aoun ali naqvi bcit c++ c# network data manipulation

About Organization:
Telenor Pakistan is 100% owned by the Telenor Group, an international provider of high quality voice, data, content and communication services in 11 markets across Europe and Asia. Telenor Group is among the largest  mobile operators in the world with 140 million mobile subscriptions and a workforce of approximately 30,000.

Telenor Pakistan is the country's single largest European foreign direct investor, with investments in excess of US$2 billion. It acquired a GSM license in 2004 and began commercial operations on March 15, 2005.

At the end of December 2011 it had a reported subscriber base of 28.11 million, and a market share of 24% making it the country's second largest mobile operator.

Reason for selecting Telenor Pakistan

Reason#1:
Offering mobile financial services
Telenor Pakistan acquired 51% of Tameer Microfinance Bank in November 2008. In 2009 it launched 'easy paisa' to become Pakistan's first telecom operator to partner with a bank to offer mobile financial services across Pakistan.

Contributing to Pakistan's economy
The company continues to contribute to Pakistan's economy. It has created 3,000 direct and 25,000 plus indirect jobs and has a network of over 180,000 retailers, franchises and sales & service centers, thus providing a means to livelihood to thousands.
For 2011 it is estimated that Telenor Pakistan contributed over Rs. 23 billion in various forms of direct and indirect taxes to the economy of Pakistan.

Reason#2
Internet service provider
Telenor Pakistan provides wide EDGE connectivity across the country. It has one of the largest data networks (GPRS) in Pakistan providing Internet services to customers.

Today
Telenor Pakistan has grown to become a leading mobile communications services provider of the country.

Telenor Pakistan's corporate headquarters are in Islamabad, with regional offices in Karachi, Lahore, Faisalabad, Multan, Hyderabad and Peshawar
Reason#3:
Corporate Responsibility
Telenor Pakistan's flagship corporate responsibility program, Khuddar Pakistan, aims to create dignified opportunities for persons with disabilities. The purpose is to become the most disabled-friendly organization in Pakistan in terms of employment, service, and community support.

Environmentally conscious
Telenor Pakistan has taken and continues to implement a number of environmentally-friendly initiatives. These include mainstreaming energy efficiency and alternate energy solutions, and implementing occupational health & safety practices that comply with international standards.

Growing Responsibly
Feb 11
Telenor Pakistan crosses the 25 million subscriber mark
Feb 11
Djuice launches ‘Khamoshi Ka Boycott’
Feb 11
Karo Mumkin projects launched
Mar 11 
Celebrates 6th birthday
Apr 11
Karo Mumkin receives ‘Best Branded Programming Project in
the Asia-Pacific region’ award in the Asia Pacific Content Awards
Apr 11
Telenor HumQadam launched
May 11
Karo Mumkin campaign wins award in ‘Public Service, Govt. & CSR’
category at the Pakistan Advertisers Society awards in Karachi
May 11
Telenor Pakistan achieves leading position in Business Intelligence
Groupwide’s BI Magic Quadrant results for the third year in a row
May 11
BCG Report launched ‘Shaping our financial future: Socio-economic
impact of mobile financial services’
May 11
Telenor Pakistan crosses the 26 million subscriber mark
Jun 11
Easypaisa wins Shaukat Khanum Social Responsibility Award
Aug 11
Djuice launches youth anthem ‘Kya Darta Hai’
Aug 11
Telenor Pakistan wins Prime Minister of Pakistan Trophy 2011 (Telecom Sector category) under the auspices of LCCI

Reason#4
Having A Large Records of the Customers &  Operations
Due to having a 2nd Largest Network in Pakistan It has a mass records of the Customers of any type and age and different Operational records are also maintained Like Different offers ,Smart tunes , Messages & call packages Talkshalk ,Djuice ,Persona etc and Prepaid and postpaid billings ,recharge ,Transfer balance ,quizzes ,Day night Packages, Friends and family (F&F) Voice call ,Voice Messages (Bubble messages) MMS and other transactions.
QUESTIONNAIRE:

1.      Who are your clients?
2.      What are your client’s requirements?
3.      How many Connections do you sale in the period of a month?
4.      Which workflow are you now following? Any software implemented?
5.      If yes? Then is it a specialized for your company or just any software to do regular office tasks?
6.      Do you have data experts or just the data entry operators?
7.      Are you completely satisfied with the current workflow? What are the problems you are facing with current workflow definition?
8.      How much historical data is saved in your database?
9.      What data is stored during a call is made by your client?
10.  Do you store data related to your employees/staff?
11.  Do you have any defined access rights for your data?
12.  What type of data needs to be updated in your data warehouse?
13.  How long should be the duration between data update?
14.  Who has the final say in decision making?
15.  What do you think why a customer selects your company when there are a numerous Telecommunication companies in Pakistan?
Gathered Information:
1.      As we are the second largest telecommunication company of Pakistan ,our Most clients are related to business class ,Youngsters and Middle class more than 2.0 Million Customer are there in Pakistan only.   
2.      Our clients require Affordable call rates and SMS/MMS Packages for the Local and International Services In fact they also require the better internet services facility  for their smart phones in affordable rate and speed.
3.      In Pakistan 958290 Connections are sold every month of different Telecom Companies in which Telenor connections are  35% (335401) Per month for both Post Paid and Pre Paid.
4.      Yes We use Different ERPs For different Operations of the organizations
5.      Telenor Pakistan is using mainly software’s for recording the data for other process improves their standard and company working
·         Oracle ERP is Using by Telenor
·         Shop Tool
·         Siebel Partner Portal ( This software is responsible for the entries recording purpose of client whole data ,the phone number allotted to them or Sims issued by the Telenor benefits are No chance of Fraud ,See financial position of the firm, Daily transactions Accurate results, Keep the whole record)
·         Chris Express ( it is a read only software in which clients Information are saved but cannot be altered or changed ,Clients can get information but cannot altered that information Benefits are Postpaid call timings can get from it ,Billing details  of Post Paid Customers is provided over there ,Each call is recorded in it, Customer can get their info where he is calling at a particular time and date , in case of any miss happen recorded data give help to that one)
·         Janiva (Telenor use This Software for the Prepaid Connection along with all details of prepaid the benefits are easy Load Verification, Time balance transfer ,Number Dialed by subscriber ,Company has proved of it )


6  .      Mr. Lars Christian (CEO-Telenor Pakistan)  told us that they are having A Team of Data Experts and Data entry Operators in our Head Office Islamabad and we are also having the Team of Data Entry operators in Our Franchise and in Other branches of Telenor in Different cities of Pakistan
7.      We are Partially satisfied, The issue is that we want more Intelligent data processes which would be helpful for us in Business Strategic Plan, We Want to be the First Largest Telecom Company of Pakistan Instead of Second Largest.
8.      From The Launching date of the Company We have recorded information of our Clients and Employees we have data from 15 –March 2005 when we launched our company in Pakistan (Islamabad, Karachi Lahore etc) more than 15000 employees are there in Pakistan.
9.      The user Connection Number ,call timings ,Duration Packages ,Charges Date from and to Numbers are saved when a call is made by the customer
10.  Yes we store the data related to our each Employee or staff their Designations, Duty Timings, salary packages, Roles  etc.
11.  Aamir Ibrahim head of corporate Affairs told that they provides the views and roles to different managers and staff for the client confidentiality, security and better services purpose we provides different roles to our Customer relation services and also maintain the logs when any employee wants to see the clients information.
12.  Mainly transactional data and regular cost.
13.  As we do the closing of records after every six months, so should the data be updated
14.  Chief executive , department Executives and board of directors
15.  Our company undergoes the process of benchmarking in every quartile of the year in which we analyze the working flow of our competitors and try to work one step ahead of them and that’s why we are one of the best Telecommunication companies in Pakistan