Click here to Skip to main content
15,897,518 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
C#
string query3 = "Select Ijarah_id from IJARAH_REQUEST where Ijarah_id IN(Select Ijarah_id,Installment_no,Date,Amount from SCHEDULE_OF_INSTALLMENT where Installment_no='" + txttransactionnumber.Text + "' AND Ijarah_id. IJARAH_REQUEST = '"+txtijarahid.Text+ "')";
            //MessageBox.Show(query1);
            da = new SqlDataAdapter(query3, cn);
            dt = new DataTable();
            da.Fill(dt);

            if (dt.Rows.Count == 0)
            {
                MessageBox.Show("This Ijarah id '" + txtijarahid.Text + "' Does not Exists\n Plz first enter the record of ijarah request!!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtijarahid.Focus();
Posted

1 solution

You can't have multiple columns selected in the subquery. Only select the Ijarah_id in the subquery for the IN clause.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900