Pages

Tuesday, July 29, 2014

Differences between SQLite and MySQL

Today I'm going to talk about differences between SQLite and MySQL and in which cases it is better to use the first or the latter one. You can’t really compare these two, I will try to explain why this is the case and when it is better to use the first or the latter.

SQLite is a single-file based database which is useful for testing and for embedding in applications. This means that all the information is stored in a single file on a file system and you use a SQLite library to open this file to read and write your data.

MySQL is a database server which got different forms to store its data (engines) and will server the data to request comming from applications who connect to it.

SQLite:
  • Fast setup. You only need to include a library into your app.
  • Embedded. No need to think about connections
  • Easy Testing. Many frameworks for example Rails use SQLite as testing database
  • No scaling
  • No users and permissions. Everyone who can access the file can access all data.
  • No performance improvements. Sqlite doesn’t cache queries, optimizes selects, etc
MySQL:
  • Scaling. MySQL can easily grow if the application using it needs more. It can even run in a cluster environment
  • Better options for performance tuning. MySQL can be configured to fit to the requierements of your application
  • Fit for a production database
  • User permissions. You can create permisions for different actions on databases, etc.

Friday, June 6, 2014

Vb.Net code for Login Function with SQL Server 2008 database

Here is the complete Vb.Net 2010 code for Login Function with SQL Server 2008 database

Design the Login form with Username and Password text fields and Login button and Clear button. Then paste the code given below according to the button or the text field.

For more details visit my Tech Net Article or Tweet me : @MaxRohana

Imports System.Data
Imports System.Data.SqlClient

Public Class Form1

         Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load

         End Sub

        'Login Button
    Private Sub btnlogin_Click(sender As System.Object, e As System.EventArgs) Handles btnlogin.Click
    
    ConnectToSQL()

    End Sub

    'Connect to SQL method

    Private Sub ConnectToSQL()

    Dim con As New SqlConnection
    Dim cmd As New SqlCommand
    Dim Password As String
    Dim Passwrd2 As String
    Dim userName As String

    Try
        If
            'change the data source and initial catalog according to your sql server engine and data base
            con.ConnectionString = "Data Source = YOUR-PC; Initial Catalog = YOUR-DB; Integrated Security = True"
            con.Open()

            cmd.Connection = con
            'change the data fields names and table according to your database
            cmd.CommandText = " SELECT  UserName, Password FROM   Table-Name WHERE   (UserName = '" & txtUsername.Text & "' ) AND (Password = '" & txtPassword.Text & "')"

            Dim lrd As SqlDataReader = cmd.ExecuteReader()
            If lrd.HasRows Then
                While lrd.Read()

                    'Do something here
                    Password = lrd("Password").ToString()
                    userName = lrd("UserName").ToString()

                    Password2 = txtPassword.Text()

                    If Password = Password2 And userName = txtUsername.Text Then

                        MessageBox.Show("Logged in successfully as " & userName, "", MessageBoxButtons.OK, MessageBoxIcon.Information
                                        )
                        frmMain.Show()
                        Me.Hide()

                        'Clear all fields
                        txtPassword.Text = ""
                        txtUsername.Text = ""

                    End If

                End While

            Else
                MessageBox.Show("Username and Password do not match..", "Authentication Failure", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
                'Clear all fields
                txtPassword.Text = ""
                txtUsername.Text = ""
            End If

        End If

    Catch ex As Exception
        MessageBox.Show("Error while connecting to SQL Server." & ex.Message)

    Finally
        con.Close() 'Whether there is error or not. Close the connection.

    End Try
 
     End Sub

    Private Sub txtUsername_TextChanged(sender As System.Object, e As System.EventArgs) Handles txtUsername.TextChanged
    End Sub
    Private Sub txtPassword_TextChanged(sender As System.Object, e As System.EventArgs) Handles txtPassword.TextChanged
    End Sub
    Private Sub btnClear_Click(sender As System.Object, e As System.EventArgs) Handles btnClear.Click
        'User clicking on cancel button only clears field
        ' and refocus to first field
        txtUsername.Text = ""
        txtPassword.Text = ""
        txtUsername.Focus()
    End Sub
End Class

Saturday, May 24, 2014

Imagine Cup 2014 is here – How can one take it on?


Imagine Cup is the world’s largest and most famous software development competition for Computer Sciences & Engineering, Information Technology and Information Systems undergraduates. Imagine Cup competition is called the Oscars or the Olympics of software development competitions for the IT undergraduates around the world.  For every IT undergraduate, wining Imagine Cup is their biggest dream in their life.

Imagine Cup was an idea of Microsoft former CEO Bill Gates, who strongly believes that young and fresh talent can create innovations and change the world taking it into another dimension. Based on his idea, the world’s biggest software development company Microsoft launched this competition for the first time in 2004. Since then millions of students around the world compete each other with impressive innovative ideas and projects not only to win this competition, but also do some change in the world.

Over the years, many mind-blowing innovations, charity projects, fancy games were build by the most talented IT Undergraduates creating great impact to areas like mechatronics, healthcare, Smart Phone apps and many more. Thousands of new startups started because of these projects and  now they earn millions and millions of money out of them. Some projects are running as a charity and serve the millions of people around the world to uplift their life standards.

Since 2004, Imagine Cup has happened nine times up to now, so in year 2014 Imagine Cup is going to be the 10th Imagine Cup and its a cause for celebrations. Microsoft Sri Lanka also conduct this competition over the years and this year it will happen on 25th of April at Peradeniya University. There are 14 teams in three different categories which compete with each other to win the competition in each category. For each category, there will be only one winner, but other teams can also consider themselves as winners too for coming thus far.

I told many stories about Imagine Cup in this article, but why? Because I’m also a competitor of Imagine Cup Srilankan finals in 2012 and also 1st runner up in innovation category in 2013 and finalist of this year Imagine Cup finals too. Since I was a finalist in 2012 to now, I have lots of stories to share with you. But apart from them I’ll tell you some important things that you may need to know about it. Because it may help you, may be your friend, even your institute to win this competition and do some good thing to the world.
  • Find a great business idea which can  be executed well in the challenging world.
  • Find ways to build that business idea into a real world solution.
  • Don’t worry about the technology, it will come to you when you try to find it.
  • Be smart to find the necessary skills and resources for your project.
  • Assign the tasks according to the skills of the team member.
  • Sacrifice little bit of your life for your project, which will earn not only money but also the recognition.
  • Think, Think and Think. Finally brainstorming with your team.
  • Never give up when you face failure, keep concentrating and try it in another way.
  • Don’t go behind success, then it will not come to you. But go behind the goals that you need to go. Then success will come behind you.
  • Learn everything in your project 100% and share among your team.
  • Never underestimate your competitors and prepare everything for the project.
  • Teat your team members equally and work with them in a friendly manner. Stress may create conflicts between team members.
These things helped me a lot to achieve many milestones in this Imagine Cup. Not only Imagine Cup, but also any project in your life can be successful if you follow above mentioned things.

Don’t worry about it if  you are not selected for any competition like Imagine Cup. Keep trying to find the mistakes that you had done and try to mitigate them. Imagine Cup is kind of an exam which test your technological skills, business skills, management skills and confidence to achieve your goal.
Let’s make this world a better place through sustainable technological revolution. Wishes to all competing in Imagine Cup 2014, let’s bring glory to Sri Lanka!

CIS Undergraduates visit IFS & Virtusa


Annual industrial visit to software giants IFS and Virtusa by the fourth year batch of Computing & Information Systems (CIS) of Sabaragamuwa University was held on 15th August. Both companies are world famous software development firms which are also reputed for their human resource policies as well. The seminar and practical sessions conducted by both firms were extremely helpful for the CIS students. CIS is a new four-year special degree awarded by Sabaragamuwa University of Sri Lanka, which celebrated the passing out of its first batch this year.

Both organizations covered a wide range of topics during the sessions they conducted for us. They included the skills a computing student should acquire, an introduction to mobile computing, cloud computing, big data, embedded system development and finally  a brief introduction about various job opportunities available in the industry. They also elaborated on the skills required to be competent professionals and organizational expectations from fresh graduates.

In the first session at Virtusa, a Senior Tech Lead explained about the organization and their operational area in the industry. After that he discussed the future opportunities for the IT undergraduates and the skills undergraduates should build up along with technological expertise.


Then Virtusa introduced their annual “LAN Challenge” gaming competition. Afterwards two project managers explained about their projects. First one relating to the aviation industry and the other “Akura”, which is an open source project. In the third session all undergraduates got the chance to visit the project development environments and discuss with the project managers, developers and testers about the projects and they demonstrated how those systems really performed. This really was an  interesting team activity done by Virtusa who encouraged students to showcase their resource planning and time management abilities too. Before moving on to the next session at IFS, Virtusa provided food and beverage including lunch for all of us.

Then we visited IFS and  they briefed us about their company and the products they are delivering. Then students participated in an interactive discussion about the emerging technologies in the industry and the industrial placement opportunities for the CIS students. Members of IFS staff also provided necessary guidance for each an every individual student and exchanged their experiences with us. At the end of the sessions IFS provided refreshments as well.

This was the second industry visit of CIS undergraduates and it was a riveting experience. Our sincere gratitude goes out Virtusa and IFS for investing time and money on behalf of the new comers to the industry and showing them the path to succeed and excel in the industry.

Sunday, May 11, 2014

Vote for me..



Hi Guys I would like to say that i have selected for the international event called SUMMIT. I'm the only one who selected for this phase representing Sri Lankan

There I need to find most votes for my video i pitched there.

Here is the link for vote:

http://thesummit.co/kilimanjaro/nominees-individual#entry-126

Please vote for me and share among your friends to vote for me.

Saturday, February 22, 2014

Windows App for Uncopyrightables Blog

 rohana's blogs
 
Again a big gift from me to all of my dear readers. Again it will be another good news for you guys in this new year. 
 
Uncopyrightables blog  published its mobile version of blog reader as an Android app on 22nd of January. After a one month time again I'm going to give  you a gift. This time it is Windows Phone app, which contain not only Uncoyrightables Blog, but also three other blogs written by me. They ara Asammathaya (Sinhala Blog), The Rohana Live and Green Map Sri Lanka  blogs along with Uncopyrightables blog give you as a package.
 
So now you can read my tech articles, Sinhala articles, Motivational thoughts and articles about Nature and Environment through windows phone now.

Here is the Download Link : Uncopyrightables Windows Phone App

Hope to give you good articles in future too. Please don't forget to comment my articles and rate the app too.

Wednesday, January 22, 2014

Android App for Uncopyrightables Blog

https://play.google.com/store/apps/details?id=com.appgenz.app000084&hl=en 

Hi to all my dear readers, it another good news for you guys in this new year. Uncopyrightables blog now publish its mobile version of blog readers as Android app. So now you can read my tech articles through your android phone too.

Here is the Download Link : Uncopyrightables Android App

Hope to give you good articles in future too. Please don't forget to comment my articles and rate the app too.