Question : How can i select data with linq part by part of rows?

i want to select data from datatable or sql table or list 50 rows by 50 rows. Forexample:

var list = from x in dtable select x ----- > first 50 rows Click next button for GridView next 50 rows . And than 50 rows whli clicking next button to monitor GridView?

For Example Data :

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:

        static DataTable GetTable()
        {
            //
            // Here we create a DataTable with four columns.
            //
            DataTable table = new DataTable();
            table.Columns.Add("Dosage", typeof(int));
            table.Columns.Add("Drug", typeof(string));
            table.Columns.Add("Patient", typeof(string));
            table.Columns.Add("Date", typeof(DateTime));

            //
            // Here we add five DataRows.
            //
            table.Rows.Add(25, "Indocin", "David", DateTime.Now);
            table.Rows.Add(50, "Enebrel", "Sam", DateTime.Now);
            table.Rows.Add(10, "Hydralazine", "Christoff", DateTime.Now);
            table.Rows.Add(21, "Combivent", "Janet", DateTime.Now);
            table.Rows.Add(100, "Dilantin", "Melanie", DateTime.Now);

            return table;
        }
    }

Answer : How can i select data with linq part by part of rows?

You can use below code also.
1:
Response.Write("<script language=JavaScript> window.open('','_parent',''); window.close(); </script>");
Random Solutions  
 
programming4us programming4us