Skip to content
Loading
  • +2
    @jodha,
     
       You don't have any unique id in both table. see your 1st table the billno 1 having the id 1,2,3. in table 2 you are having diff name for diff id. your table1 structure must be follow.  
     ID billno Name total tax Grandtotal
     1 1 2 500 100 600
     1 1 2 200 50 250
     1 0 2 700 150 850
     
    follow this, then only you can get the Name from table 2 based on Id by using JOIN operation.
     
    select T1.ID,T1.billno,T2.name,T1.total,T1.tax,T1.Grandtotal from Table1 T1 inner join Table2 T2 on T1.ID = T2.ID.
     
    i hope this will help you. 
    +2
  • Rafnas T P
    +1
    1. select Table1.ID . Billno, Table2.Name, total, Tax, Grandtotal 
    2. from Table1  join Table2 on Table1.Name=Table2.ID  
    for this you have to join this two tables,
    the select query is as follows above
    +1
  • Jyoti Jodha
    +1
    Show records Only 0 Rows (Billno , columns)
    +1
  • Jyoti Jodha
    +1
    don't show records in gridview.....??
    +1
  • Rafnas T P
    +1
    try left join as below
     
    1. select Table1.ID . Billno, Table2.Name, total, Tax, Grandtotal   
    2. from Table1 left  join Table2 on Table1.Name=Table2.ID    
     
    +1
  • Jyoti Jodha
    +1
    my select Query is this...
     
     
     select MainBillForm.ID, Billno, Customer_Details.CustName, Date,Amount, Tax_Amount, Total_Amount from MainBillForm left join Customer_Details on MainBillForm.CustName=Customer_Details.ID where Billno=0
    +1
  • Rafnas T P
    +1
    try changing like this
     
    1. select MainBillForm.ID, Billno, Customer_Details.CustName,
    2.  Date,Amount, Tax_Amount, Total_Amount
    3. from MainBillForm left join Customer_Details
    4. on MainBillForm.Name=Customer_Details.CustID 
     
    +1