how to display data in table from database based on selected row from gridview
up vote
0
down vote
favorite
am trying to retrieve data from the database to be shown in a modal box containing a datatable with the details of the selected row. The problem im encountering seems to be that regardless of the rows i chose, the modal box showing the details only uses the first row from the database. heres the asp.net code for the gridview.
Gridview:
<asp:GridView ID="smry" runat="server" AutoGenerateColumns="False" OnRowCommand="GridView1_RowCommand" CssClass="list-group" >
<Columns>
<asp:ButtonField Text="View" CommandName="Viewdet"/>
<asp:TemplateField HeaderText="MRF No">
<ItemTemplate>
<asp:Label ID="mrfnoret" runat="server" Text='<%# Eval("MRF_No") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="BU" HeaderText="Business Unit" SortExpression="BU" />
<asp:BoundField DataField="Dept" HeaderText="Department" SortExpression="Dept" />
<asp:BoundField DataField="ReqByDept_Mngr" HeaderText="Reqested By" SortExpression="ReqByDept_Mngr" />
</Columns>
</asp:GridView>
code behind:
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
if(e.CommandName == "Viewdet")
{
database db = new database();
string database = db.MRF();
using (SqlConnection con = new SqlConnection(database))
{
con.Open();
string query = "SELECT [MRF_No], [BU], [Dept], [PostTitle], [ReqdPrsnl], [Rank], [JobFam], [ToEmp], [JobDesc], [Edu], [WorkExp], [ITSkills], [OpMachines], [PersonalAtt], [others], [MinSalRange], [MaxSalRange], [ReqByDept_Mngr], [NoteBy_Bu_Head], [AppByHR_Mngr] FROM MRF_Details"
+ "";
using (SqlCommand com = new SqlCommand(query, con))
using (SqlDataAdapter sda = new SqlDataAdapter(query, con))
{
DataTable dt = new DataTable();
sda.Fill(dt);
details.DataSource = dt;
details.DataBind();
}
con.Close();
}
ScriptManager.RegisterClientScriptBlock(this, this.GetType(),"Pop", "openModal();", true);
}
}
Incase some are wondering i want to retrieve data from the database and show it in a modal box. here is the modal box code as well.
<div id="TestModal" class="modal fade" role="dialog">
<div class="modal-dialog modal-lg ">
<%-- MODAL CONTENT --%>
<div class="modal-content">
<div class="modal-header">
<asp:Label class="modal-title" runat="server" Text="DETAILS" CssClass="text-pos"></asp:Label>
</div>
<div class="modal-body modalScroll">
<div class ="row next">
<asp:DetailsView runat="server" ID="details" CssClass="table" AutoGenerateRows="false">
<Fields>
<asp:BoundField DataField="MRF_No" HeaderText="MRF No" SortExpression="MRF_No" />
<asp:BoundField DataField="BU" HeaderText="BUSINESS UNIT:" SortExpression="BU" />
<asp:BoundField DataField="Dept" HeaderText="DEPARTMENT:" SortExpression="Dept" />
<asp:BoundField DataField="PostTitle" HeaderText="POSITION TITLE:" SortExpression="PostTitle" />
<asp:BoundField DataField="ReqdPrsnl" HeaderText="NO. OF REQ'D PERSONNEL:" SortExpression="ReqdPrsnl" />
<asp:BoundField DataField="Rank" HeaderText="RANK / LEVEL" SortExpression="Rank" />
<asp:BoundField DataField="JobFam" HeaderText="JOB FAMILY" SortExpression="JobFam" />
<asp:BoundField DataField="ToEmp" HeaderText="TERMS OF EMPLOYMENT" SortExpression="ToEmp" />
<asp:BoundField DataField="JobDesc" HeaderText="DUTIES AND RESPONSIBILITIES" SortExpression="JobDesc" />
<asp:BoundField DataField="Edu" HeaderText="EDUCATION / PRC LICENSES / CERTIFICATIONS" SortExpression="Edu" />
<asp:BoundField DataField="WorkExp" HeaderText="Work Experience" SortExpression="WorkExp" />
<asp:BoundField DataField="ITSkills" HeaderText="IT SKILLS / SOFTWARE & HARDWARE PROFICIENCIES" SortExpression="ITSkills" />
<asp:BoundField DataField="OpMachines" HeaderText="OPERATIONS OF MACHINES" SortExpression="OpMachines" />
<asp:BoundField DataField="PersonalAtt" HeaderText="PERSONAL ATTRIBUTES" SortExpression="PersonalAtt" />
<asp:BoundField DataField="others" HeaderText="OTHERS" SortExpression="others" />
<asp:BoundField DataField="MinSalRange" HeaderText="Minimum Salary Range" SortExpression="MinSalRange" />
<asp:BoundField DataField="MaxSalRange" HeaderText="Maximum Salary Range" SortExpression="MaxSalRange" />
<asp:BoundField DataField="ReqByDept_Mngr" HeaderText="REQUESTED BY:" SortExpression="ReqByDept_Mngr" />
<asp:BoundField DataField="NoteBy_Bu_Head" HeaderText="NOTED BY:" SortExpression="NoteBy_Bu_Head" />
<asp:BoundField DataField="AppByHR_Mngr" HeaderText="APPROVED BY:" SortExpression="AppByHR_Mngr" />
</Fields>
</asp:DetailsView>
</div>
</div>
<div class="modal-footer">
<asp:Button ID="close2" runat="server" Text="Close" data-dismiss="modal" />
</div>
</div>
</div>
</div>
c# asp.net gridview
add a comment |
up vote
0
down vote
favorite
am trying to retrieve data from the database to be shown in a modal box containing a datatable with the details of the selected row. The problem im encountering seems to be that regardless of the rows i chose, the modal box showing the details only uses the first row from the database. heres the asp.net code for the gridview.
Gridview:
<asp:GridView ID="smry" runat="server" AutoGenerateColumns="False" OnRowCommand="GridView1_RowCommand" CssClass="list-group" >
<Columns>
<asp:ButtonField Text="View" CommandName="Viewdet"/>
<asp:TemplateField HeaderText="MRF No">
<ItemTemplate>
<asp:Label ID="mrfnoret" runat="server" Text='<%# Eval("MRF_No") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="BU" HeaderText="Business Unit" SortExpression="BU" />
<asp:BoundField DataField="Dept" HeaderText="Department" SortExpression="Dept" />
<asp:BoundField DataField="ReqByDept_Mngr" HeaderText="Reqested By" SortExpression="ReqByDept_Mngr" />
</Columns>
</asp:GridView>
code behind:
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
if(e.CommandName == "Viewdet")
{
database db = new database();
string database = db.MRF();
using (SqlConnection con = new SqlConnection(database))
{
con.Open();
string query = "SELECT [MRF_No], [BU], [Dept], [PostTitle], [ReqdPrsnl], [Rank], [JobFam], [ToEmp], [JobDesc], [Edu], [WorkExp], [ITSkills], [OpMachines], [PersonalAtt], [others], [MinSalRange], [MaxSalRange], [ReqByDept_Mngr], [NoteBy_Bu_Head], [AppByHR_Mngr] FROM MRF_Details"
+ "";
using (SqlCommand com = new SqlCommand(query, con))
using (SqlDataAdapter sda = new SqlDataAdapter(query, con))
{
DataTable dt = new DataTable();
sda.Fill(dt);
details.DataSource = dt;
details.DataBind();
}
con.Close();
}
ScriptManager.RegisterClientScriptBlock(this, this.GetType(),"Pop", "openModal();", true);
}
}
Incase some are wondering i want to retrieve data from the database and show it in a modal box. here is the modal box code as well.
<div id="TestModal" class="modal fade" role="dialog">
<div class="modal-dialog modal-lg ">
<%-- MODAL CONTENT --%>
<div class="modal-content">
<div class="modal-header">
<asp:Label class="modal-title" runat="server" Text="DETAILS" CssClass="text-pos"></asp:Label>
</div>
<div class="modal-body modalScroll">
<div class ="row next">
<asp:DetailsView runat="server" ID="details" CssClass="table" AutoGenerateRows="false">
<Fields>
<asp:BoundField DataField="MRF_No" HeaderText="MRF No" SortExpression="MRF_No" />
<asp:BoundField DataField="BU" HeaderText="BUSINESS UNIT:" SortExpression="BU" />
<asp:BoundField DataField="Dept" HeaderText="DEPARTMENT:" SortExpression="Dept" />
<asp:BoundField DataField="PostTitle" HeaderText="POSITION TITLE:" SortExpression="PostTitle" />
<asp:BoundField DataField="ReqdPrsnl" HeaderText="NO. OF REQ'D PERSONNEL:" SortExpression="ReqdPrsnl" />
<asp:BoundField DataField="Rank" HeaderText="RANK / LEVEL" SortExpression="Rank" />
<asp:BoundField DataField="JobFam" HeaderText="JOB FAMILY" SortExpression="JobFam" />
<asp:BoundField DataField="ToEmp" HeaderText="TERMS OF EMPLOYMENT" SortExpression="ToEmp" />
<asp:BoundField DataField="JobDesc" HeaderText="DUTIES AND RESPONSIBILITIES" SortExpression="JobDesc" />
<asp:BoundField DataField="Edu" HeaderText="EDUCATION / PRC LICENSES / CERTIFICATIONS" SortExpression="Edu" />
<asp:BoundField DataField="WorkExp" HeaderText="Work Experience" SortExpression="WorkExp" />
<asp:BoundField DataField="ITSkills" HeaderText="IT SKILLS / SOFTWARE & HARDWARE PROFICIENCIES" SortExpression="ITSkills" />
<asp:BoundField DataField="OpMachines" HeaderText="OPERATIONS OF MACHINES" SortExpression="OpMachines" />
<asp:BoundField DataField="PersonalAtt" HeaderText="PERSONAL ATTRIBUTES" SortExpression="PersonalAtt" />
<asp:BoundField DataField="others" HeaderText="OTHERS" SortExpression="others" />
<asp:BoundField DataField="MinSalRange" HeaderText="Minimum Salary Range" SortExpression="MinSalRange" />
<asp:BoundField DataField="MaxSalRange" HeaderText="Maximum Salary Range" SortExpression="MaxSalRange" />
<asp:BoundField DataField="ReqByDept_Mngr" HeaderText="REQUESTED BY:" SortExpression="ReqByDept_Mngr" />
<asp:BoundField DataField="NoteBy_Bu_Head" HeaderText="NOTED BY:" SortExpression="NoteBy_Bu_Head" />
<asp:BoundField DataField="AppByHR_Mngr" HeaderText="APPROVED BY:" SortExpression="AppByHR_Mngr" />
</Fields>
</asp:DetailsView>
</div>
</div>
<div class="modal-footer">
<asp:Button ID="close2" runat="server" Text="Close" data-dismiss="modal" />
</div>
</div>
</div>
</div>
c# asp.net gridview
Yourselect ...
query in C# doesn't depend on a parent row value / key. This is why you receive the same data for all rows. You can send a parameter intoGridView1_RowCommand
usingCommandArgument
attribute of the button.
– Alex Kudryashev
Nov 18 at 17:33
May i know how to apply it here in my code??
– allos
Nov 19 at 0:30
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
am trying to retrieve data from the database to be shown in a modal box containing a datatable with the details of the selected row. The problem im encountering seems to be that regardless of the rows i chose, the modal box showing the details only uses the first row from the database. heres the asp.net code for the gridview.
Gridview:
<asp:GridView ID="smry" runat="server" AutoGenerateColumns="False" OnRowCommand="GridView1_RowCommand" CssClass="list-group" >
<Columns>
<asp:ButtonField Text="View" CommandName="Viewdet"/>
<asp:TemplateField HeaderText="MRF No">
<ItemTemplate>
<asp:Label ID="mrfnoret" runat="server" Text='<%# Eval("MRF_No") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="BU" HeaderText="Business Unit" SortExpression="BU" />
<asp:BoundField DataField="Dept" HeaderText="Department" SortExpression="Dept" />
<asp:BoundField DataField="ReqByDept_Mngr" HeaderText="Reqested By" SortExpression="ReqByDept_Mngr" />
</Columns>
</asp:GridView>
code behind:
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
if(e.CommandName == "Viewdet")
{
database db = new database();
string database = db.MRF();
using (SqlConnection con = new SqlConnection(database))
{
con.Open();
string query = "SELECT [MRF_No], [BU], [Dept], [PostTitle], [ReqdPrsnl], [Rank], [JobFam], [ToEmp], [JobDesc], [Edu], [WorkExp], [ITSkills], [OpMachines], [PersonalAtt], [others], [MinSalRange], [MaxSalRange], [ReqByDept_Mngr], [NoteBy_Bu_Head], [AppByHR_Mngr] FROM MRF_Details"
+ "";
using (SqlCommand com = new SqlCommand(query, con))
using (SqlDataAdapter sda = new SqlDataAdapter(query, con))
{
DataTable dt = new DataTable();
sda.Fill(dt);
details.DataSource = dt;
details.DataBind();
}
con.Close();
}
ScriptManager.RegisterClientScriptBlock(this, this.GetType(),"Pop", "openModal();", true);
}
}
Incase some are wondering i want to retrieve data from the database and show it in a modal box. here is the modal box code as well.
<div id="TestModal" class="modal fade" role="dialog">
<div class="modal-dialog modal-lg ">
<%-- MODAL CONTENT --%>
<div class="modal-content">
<div class="modal-header">
<asp:Label class="modal-title" runat="server" Text="DETAILS" CssClass="text-pos"></asp:Label>
</div>
<div class="modal-body modalScroll">
<div class ="row next">
<asp:DetailsView runat="server" ID="details" CssClass="table" AutoGenerateRows="false">
<Fields>
<asp:BoundField DataField="MRF_No" HeaderText="MRF No" SortExpression="MRF_No" />
<asp:BoundField DataField="BU" HeaderText="BUSINESS UNIT:" SortExpression="BU" />
<asp:BoundField DataField="Dept" HeaderText="DEPARTMENT:" SortExpression="Dept" />
<asp:BoundField DataField="PostTitle" HeaderText="POSITION TITLE:" SortExpression="PostTitle" />
<asp:BoundField DataField="ReqdPrsnl" HeaderText="NO. OF REQ'D PERSONNEL:" SortExpression="ReqdPrsnl" />
<asp:BoundField DataField="Rank" HeaderText="RANK / LEVEL" SortExpression="Rank" />
<asp:BoundField DataField="JobFam" HeaderText="JOB FAMILY" SortExpression="JobFam" />
<asp:BoundField DataField="ToEmp" HeaderText="TERMS OF EMPLOYMENT" SortExpression="ToEmp" />
<asp:BoundField DataField="JobDesc" HeaderText="DUTIES AND RESPONSIBILITIES" SortExpression="JobDesc" />
<asp:BoundField DataField="Edu" HeaderText="EDUCATION / PRC LICENSES / CERTIFICATIONS" SortExpression="Edu" />
<asp:BoundField DataField="WorkExp" HeaderText="Work Experience" SortExpression="WorkExp" />
<asp:BoundField DataField="ITSkills" HeaderText="IT SKILLS / SOFTWARE & HARDWARE PROFICIENCIES" SortExpression="ITSkills" />
<asp:BoundField DataField="OpMachines" HeaderText="OPERATIONS OF MACHINES" SortExpression="OpMachines" />
<asp:BoundField DataField="PersonalAtt" HeaderText="PERSONAL ATTRIBUTES" SortExpression="PersonalAtt" />
<asp:BoundField DataField="others" HeaderText="OTHERS" SortExpression="others" />
<asp:BoundField DataField="MinSalRange" HeaderText="Minimum Salary Range" SortExpression="MinSalRange" />
<asp:BoundField DataField="MaxSalRange" HeaderText="Maximum Salary Range" SortExpression="MaxSalRange" />
<asp:BoundField DataField="ReqByDept_Mngr" HeaderText="REQUESTED BY:" SortExpression="ReqByDept_Mngr" />
<asp:BoundField DataField="NoteBy_Bu_Head" HeaderText="NOTED BY:" SortExpression="NoteBy_Bu_Head" />
<asp:BoundField DataField="AppByHR_Mngr" HeaderText="APPROVED BY:" SortExpression="AppByHR_Mngr" />
</Fields>
</asp:DetailsView>
</div>
</div>
<div class="modal-footer">
<asp:Button ID="close2" runat="server" Text="Close" data-dismiss="modal" />
</div>
</div>
</div>
</div>
c# asp.net gridview
am trying to retrieve data from the database to be shown in a modal box containing a datatable with the details of the selected row. The problem im encountering seems to be that regardless of the rows i chose, the modal box showing the details only uses the first row from the database. heres the asp.net code for the gridview.
Gridview:
<asp:GridView ID="smry" runat="server" AutoGenerateColumns="False" OnRowCommand="GridView1_RowCommand" CssClass="list-group" >
<Columns>
<asp:ButtonField Text="View" CommandName="Viewdet"/>
<asp:TemplateField HeaderText="MRF No">
<ItemTemplate>
<asp:Label ID="mrfnoret" runat="server" Text='<%# Eval("MRF_No") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="BU" HeaderText="Business Unit" SortExpression="BU" />
<asp:BoundField DataField="Dept" HeaderText="Department" SortExpression="Dept" />
<asp:BoundField DataField="ReqByDept_Mngr" HeaderText="Reqested By" SortExpression="ReqByDept_Mngr" />
</Columns>
</asp:GridView>
code behind:
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
if(e.CommandName == "Viewdet")
{
database db = new database();
string database = db.MRF();
using (SqlConnection con = new SqlConnection(database))
{
con.Open();
string query = "SELECT [MRF_No], [BU], [Dept], [PostTitle], [ReqdPrsnl], [Rank], [JobFam], [ToEmp], [JobDesc], [Edu], [WorkExp], [ITSkills], [OpMachines], [PersonalAtt], [others], [MinSalRange], [MaxSalRange], [ReqByDept_Mngr], [NoteBy_Bu_Head], [AppByHR_Mngr] FROM MRF_Details"
+ "";
using (SqlCommand com = new SqlCommand(query, con))
using (SqlDataAdapter sda = new SqlDataAdapter(query, con))
{
DataTable dt = new DataTable();
sda.Fill(dt);
details.DataSource = dt;
details.DataBind();
}
con.Close();
}
ScriptManager.RegisterClientScriptBlock(this, this.GetType(),"Pop", "openModal();", true);
}
}
Incase some are wondering i want to retrieve data from the database and show it in a modal box. here is the modal box code as well.
<div id="TestModal" class="modal fade" role="dialog">
<div class="modal-dialog modal-lg ">
<%-- MODAL CONTENT --%>
<div class="modal-content">
<div class="modal-header">
<asp:Label class="modal-title" runat="server" Text="DETAILS" CssClass="text-pos"></asp:Label>
</div>
<div class="modal-body modalScroll">
<div class ="row next">
<asp:DetailsView runat="server" ID="details" CssClass="table" AutoGenerateRows="false">
<Fields>
<asp:BoundField DataField="MRF_No" HeaderText="MRF No" SortExpression="MRF_No" />
<asp:BoundField DataField="BU" HeaderText="BUSINESS UNIT:" SortExpression="BU" />
<asp:BoundField DataField="Dept" HeaderText="DEPARTMENT:" SortExpression="Dept" />
<asp:BoundField DataField="PostTitle" HeaderText="POSITION TITLE:" SortExpression="PostTitle" />
<asp:BoundField DataField="ReqdPrsnl" HeaderText="NO. OF REQ'D PERSONNEL:" SortExpression="ReqdPrsnl" />
<asp:BoundField DataField="Rank" HeaderText="RANK / LEVEL" SortExpression="Rank" />
<asp:BoundField DataField="JobFam" HeaderText="JOB FAMILY" SortExpression="JobFam" />
<asp:BoundField DataField="ToEmp" HeaderText="TERMS OF EMPLOYMENT" SortExpression="ToEmp" />
<asp:BoundField DataField="JobDesc" HeaderText="DUTIES AND RESPONSIBILITIES" SortExpression="JobDesc" />
<asp:BoundField DataField="Edu" HeaderText="EDUCATION / PRC LICENSES / CERTIFICATIONS" SortExpression="Edu" />
<asp:BoundField DataField="WorkExp" HeaderText="Work Experience" SortExpression="WorkExp" />
<asp:BoundField DataField="ITSkills" HeaderText="IT SKILLS / SOFTWARE & HARDWARE PROFICIENCIES" SortExpression="ITSkills" />
<asp:BoundField DataField="OpMachines" HeaderText="OPERATIONS OF MACHINES" SortExpression="OpMachines" />
<asp:BoundField DataField="PersonalAtt" HeaderText="PERSONAL ATTRIBUTES" SortExpression="PersonalAtt" />
<asp:BoundField DataField="others" HeaderText="OTHERS" SortExpression="others" />
<asp:BoundField DataField="MinSalRange" HeaderText="Minimum Salary Range" SortExpression="MinSalRange" />
<asp:BoundField DataField="MaxSalRange" HeaderText="Maximum Salary Range" SortExpression="MaxSalRange" />
<asp:BoundField DataField="ReqByDept_Mngr" HeaderText="REQUESTED BY:" SortExpression="ReqByDept_Mngr" />
<asp:BoundField DataField="NoteBy_Bu_Head" HeaderText="NOTED BY:" SortExpression="NoteBy_Bu_Head" />
<asp:BoundField DataField="AppByHR_Mngr" HeaderText="APPROVED BY:" SortExpression="AppByHR_Mngr" />
</Fields>
</asp:DetailsView>
</div>
</div>
<div class="modal-footer">
<asp:Button ID="close2" runat="server" Text="Close" data-dismiss="modal" />
</div>
</div>
</div>
</div>
c# asp.net gridview
c# asp.net gridview
asked Nov 18 at 14:54
allos
134
134
Yourselect ...
query in C# doesn't depend on a parent row value / key. This is why you receive the same data for all rows. You can send a parameter intoGridView1_RowCommand
usingCommandArgument
attribute of the button.
– Alex Kudryashev
Nov 18 at 17:33
May i know how to apply it here in my code??
– allos
Nov 19 at 0:30
add a comment |
Yourselect ...
query in C# doesn't depend on a parent row value / key. This is why you receive the same data for all rows. You can send a parameter intoGridView1_RowCommand
usingCommandArgument
attribute of the button.
– Alex Kudryashev
Nov 18 at 17:33
May i know how to apply it here in my code??
– allos
Nov 19 at 0:30
Your
select ...
query in C# doesn't depend on a parent row value / key. This is why you receive the same data for all rows. You can send a parameter into GridView1_RowCommand
using CommandArgument
attribute of the button.– Alex Kudryashev
Nov 18 at 17:33
Your
select ...
query in C# doesn't depend on a parent row value / key. This is why you receive the same data for all rows. You can send a parameter into GridView1_RowCommand
using CommandArgument
attribute of the button.– Alex Kudryashev
Nov 18 at 17:33
May i know how to apply it here in my code??
– allos
Nov 19 at 0:30
May i know how to apply it here in my code??
– allos
Nov 19 at 0:30
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53362200%2fhow-to-display-data-in-table-from-database-based-on-selected-row-from-gridview%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Your
select ...
query in C# doesn't depend on a parent row value / key. This is why you receive the same data for all rows. You can send a parameter intoGridView1_RowCommand
usingCommandArgument
attribute of the button.– Alex Kudryashev
Nov 18 at 17:33
May i know how to apply it here in my code??
– allos
Nov 19 at 0:30