C# .NET - Show record in list view

Asked By Dvorkin on 03-Mar-13 12:01 PM
i want to show defaulter students(who have not paid fees of this month) in list view. I have two tables in database one contains student record and other contains their fee record. Can you please tell me how to write query to solve my problem.. any help would be appreciated.
joharika reddy replied to Dvorkin on 05-Mar-13 12:14 AM
Hi  Dvorkin,
 
             By using JOIN  i executed sql query, please find the below code...

           
Protected void bindListView()
{
   SqlDataAdapter da = new SqlDataAdapter("SELECT column_name(s) FROM table_name1 INNER JOIN table_name2   ON table_name1.Student_id=table_name2.Student_id  where table_name1.Student_fee IS NULL '", con);
  DataSet ds = new DataSet();
  da.Fill(ds);
  con.Close();
Listview1.DataSource = ds;
   Listview1.DataBind(); 
  }


call this method where u want... May be helpfull