Hi all,
I have a datagrid with Button column select in form of hyperlink. On
the same page, I have another datagrid that insert data and one
column(Name) has Names of a user that is inserting data(using windows
authentication) .
Now this is how it's supposed to work: When any user want to see data
about a particular user it's a matter of selecting his name and the
data Writen by the selected user should be the only ones to be shown.
I got some examples on Google but they all seem not to be working.
When a user is selected the page remains the same data is not
selected. How would can I solve this problem?
My code looks like this:
HTML part:
<Columns>
<asp:ButtonColu mn HeaderText="Ope rations"
DataTextField=" TeamOperation" ButtonType="Lin kButton"></
asp:ButtonColum n>
</Columns>
and code behind:
private void dgoperation_Ite mCommand(object source,
System.Web.UI.W ebControls.Data GridCommandEven tArgs e)
{
SqlCommand myCommand=new SqlCommand();
myCommand.Conne ction=con;
myCommand.Comma ndText="select * from dbo.DashBoard where Name =
@Billing";
myCommand.Param eters.Add(new SqlParameter("@ Billing",SqlDbT ype.VarChar,
50));
myCommand.Param eters["@Billing"].Value= dgbilling;
SqlDataAdapter myAdapter=new SqlDataAdapter( myCommand);
DataSet ds = new DataSet();
myAdapter.Fill( ds);
dgis.DataSource =ds;
dgis.EditItemIn dex = -1;
dgis.DataBind() ;
}
dgis: this is the datagrid that where user inserts data.
dgbilling: this is the datagrid with the name list.
Thanks.
I have a datagrid with Button column select in form of hyperlink. On
the same page, I have another datagrid that insert data and one
column(Name) has Names of a user that is inserting data(using windows
authentication) .
Now this is how it's supposed to work: When any user want to see data
about a particular user it's a matter of selecting his name and the
data Writen by the selected user should be the only ones to be shown.
I got some examples on Google but they all seem not to be working.
When a user is selected the page remains the same data is not
selected. How would can I solve this problem?
My code looks like this:
HTML part:
<Columns>
<asp:ButtonColu mn HeaderText="Ope rations"
DataTextField=" TeamOperation" ButtonType="Lin kButton"></
asp:ButtonColum n>
</Columns>
and code behind:
private void dgoperation_Ite mCommand(object source,
System.Web.UI.W ebControls.Data GridCommandEven tArgs e)
{
SqlCommand myCommand=new SqlCommand();
myCommand.Conne ction=con;
myCommand.Comma ndText="select * from dbo.DashBoard where Name =
@Billing";
myCommand.Param eters.Add(new SqlParameter("@ Billing",SqlDbT ype.VarChar,
50));
myCommand.Param eters["@Billing"].Value= dgbilling;
SqlDataAdapter myAdapter=new SqlDataAdapter( myCommand);
DataSet ds = new DataSet();
myAdapter.Fill( ds);
dgis.DataSource =ds;
dgis.EditItemIn dex = -1;
dgis.DataBind() ;
}
dgis: this is the datagrid that where user inserts data.
dgbilling: this is the datagrid with the name list.
Thanks.
Comment