Is Correct Way Codding?.
I am new Programmer. I my Comp. I am the Only Programmer. So I have So many Questions. 

In my Project i am using Below Code For add. 

    MySqlConnection connection = new MySqlConnection(MyConString);
                    MySqlCommand command = connection.CreateCommand();
                    MySqlDataReader Reader;
                    command.CommandText = "select * from " + datatable + " where code='" + textBox1.Text + "'";
                    connection.Open();
                    Reader = command.ExecuteReader();
                    while (Reader.Read())
                    {
                        already = 1;
                    }
                    connection.Close();

Is this Correct Way. Or DAL, Stored Procedure, 3 tire Architure Which is most effective. And What standard Code is maintain in Companies. 

I am doing Project and Got Solutions Also. But I don't know this way is Correct or Not. 

I think Most of you understand my problem?.

Thanks in Advance....
Is Correct Way Codding?.
===

I am new Programmer. I my Comp. I am the Only Programmer. So I have So many Questions. 

In my Project i am using Below Code For add. 

    MySqlConnection connection = new MySqlConnection(MyConString);
                    MySqlCommand command = connection.CreateCommand();
                    MySqlDataReader Reader;
                    command.CommandText = "select * from " + datatable + " where code='" + textBox1.Text + "'";
                    connection.Open();
                    Reader = command.ExecuteReader();
                    while (Reader.Read())
                    {
                        already = 1;
                    }
                    connection.Close();

Is this Correct Way. Or DAL, Stored Procedure, 3 tire Architure Which is most effective. And What standard Code is maintain in Companies. 

I am doing Project and Got Solutions Also. But I don't know this way is Correct or Not. 

I think Most of you understand my problem?.

Thanks in Advance....