SqlConnection objcon = new SqlConnection(@"Data Source=VAIBHAV-0EC092B\SQLEXPRESS;Initial Catalog=Navodayagiri;Integrated Security=True");
objcon.Open();
SqlCommand objcommand1 = new SqlCommand("select Name from HolderaNames where Flat_No= " + txtflatno.Text, objcon);
txtname.Text = Convert.ToString(objcommand1.ExecuteScalar());
SqlCommand objcommand = new SqlCommand("select Remaining_Dues from DuesMaster where Flat_No= " + txtflatno.Text, objcon);
txtoutstandingdues.Text=Convert.ToString(objcommand.ExecuteScalar());
objcommand.Dispose();
objcommand1.Dispose();
objcon.Dispose();
Is this right?Can I write 2 sqlcommand statements 1 below the other?
This post has been edited by CodingSup3rnatur@l-360: 11 September 2011 - 11:43 AM
Reason for edit:: Please use code tags when posting code

New Topic/Question
Reply




MultiQuote





|