Created
August 25, 2015 04:44
-
-
Save mhaghighat20/bd10ca490e8f1933eb68 to your computer and use it in GitHub Desktop.
show_data code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Web; | |
using System.Web.UI; | |
using System.Web.UI.WebControls; | |
public partial class Account_Admin_show_data : System.Web.UI.Page | |
{ | |
protected void Page_Load(object sender, EventArgs e) | |
{ | |
var Sabt_Nam_TA = new First_Website_DSTableAdapters.Sabt_NamTableAdapter(); | |
var city_TA = new First_Website_DSTableAdapters.CitiesTableAdapter(); | |
var data_table = Sabt_Nam_TA.GetData(); | |
var city_table = city_TA.GetData(); | |
var first_linq_query = from row in data_table | |
orderby row.Name_Khanevadegi ascending | |
join city_row in city_table on row.City equals city_row.Id | |
select new | |
{ | |
row.Nam, | |
row.Name_Khanevadegi, | |
row.Code_Melli, | |
row.reshte, | |
row.Description, | |
row.tavallod, | |
row.zaman, | |
City = city_row.city_name | |
}; | |
GridView1.DataSource = first_linq_query; | |
GridView1.DataBind(); | |
} | |
protected void Submit_Click(object sender, EventArgs e) | |
{ | |
var Sabt_Nam_TA = new First_Website_DSTableAdapters.Sabt_NamTableAdapter(); | |
var data_table = Sabt_Nam_TA.GetData(); | |
var tavallod_sal = Convert.ToInt32( tavallod_filter.Text); | |
var new_linq_query = from row in data_table | |
where row.tavallod == tavallod_sal | |
orderby row.Name_Khanevadegi ascending | |
select row; | |
GridView1.DataSource = new_linq_query; | |
GridView1.DataBind(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment