Click here to Skip to main content
15,894,896 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
SQL
string A1 = " with cte0 (B,t,at,an,Bal1,c_n,t_p_a,o_d) as (select Branch,type,account_type,account_no,Bal1,customer_name,Bal2,opening_date from pigmy_payment p1 where paid_date = ( select max(convert(datetime, paid_date)) from pigmy_payment p2 where p1.account_no=p2.account_no))select r.account_no, r.customer_name from Pigmy_customers r left join cte0 c on r.account_no=c.account_no order by paid_date DESC ";
            
            DataSet  ds = g.ExecuteReader(A1, null);
            dataGridView1.DataSource = ds.Tables[0];


error is cannot find table zero
instead of using executereader what i will use........
Posted
Comments
Kats2512 5-May-15 7:20am    
this means that your dataset does not have a table, there is no data being populated into the dataset.
Member 11644272 5-May-15 7:30am    
sir in query data being populated but in data set it showing null values.......
Sascha Lefèvre 5-May-15 7:32am    
Of what exact type is g ?
Member 11644272 5-May-15 7:49am    
sir g is the global variable means we use to connect the sql server in backend.....
Member 11644272 5-May-15 7:50am    
global g = new global();

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