Click here to Skip to main content
11,485,334 members (77,851 online)
Rate this: bad
good
Please Sign up or sign in to 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 15-Nov-12 0:00am

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 380
1 Maciej Los 365
2 Mehdi Gholam 210
3 Frankie-C 134
4 OriginalGriff 134
0 Sergey Alexandrovich Kryukov 8,819
1 OriginalGriff 7,982
2 Sascha Lefèvre 3,199
3 Maciej Los 2,841
4 Richard Deeming 2,370


Advertise | Privacy | Mobile
Web01 | 2.8.150520.1 | Last Updated 16 Nov 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100