public partial class Job_Response : System.Web.UI.Page { static DataTable dt; ResponseDetail_select responseobj = new ResponseDetail_select(ConfigurationManager.ConnectionStrings["portal"].ConnectionString); protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { dt = responseobj.get_response_job(cmp_id); GridView1.DataSource = dt; GridView1.DataBind(); } } }
public DataTable get_response_job(int cmp_id) { return (dl.GetDataTable("select job_id,job_title from Recruiter_JobPost where company_id='" + cmp_id + "'")); }
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="job_id" onselectedindexchanged="GridView1_SelectedIndexChanged" Height="204px" Width="819px" onrowcommand="GridView1_RowCommand" BorderColor="#0099FF" BorderStyle="Outset" CellPadding="4" ForeColor="#333333" GridLines="None" style="margin-left: 85px" > <alternatingrowstyle backcolor="White" /> <columns> <asp:BoundField DataField="job_title" HeaderText="Job Title" SortExpression="job_title" /> <asp:TemplateField HeaderText="No of Applicants" SortExpression="total_applicants"> <itemtemplate> <asp:LinkButton ID="LinkButtonApp" runat="server" CommandName="App" CommandArgument='<%#Eval("job_id")%>' >Applicants </itemtemplate> </columns>
dt
Rows.Count
Label1.Text = "Rows count: " + dt.Rows.Count.ToString();
int i = 0; foreach(DataRow dr in dt.Rows) { i++; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)