gridview里面一个按钮的赋值问题
<asp:TemplateField HeaderText="操作" ShowHeader="False">
<ItemTemplate>
<asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="false"
CommandName="" Text="查看"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
上面是gridview里的操作按钮,我是想实现通过改变鉴定状态来关联操作的内容.代码应该具体怎么写??
下面是数据库连接后的代码,然后不知道写了:
String reportPath = @"\Identify.accdb";
string ConStr = "Provider=Microsoft.ACE.OLEDB.12.0;Data source=" + reportPath;
ocon = new OleDbConnection(ConStr);
ocon.Open();
string Jdid = "110001";
String strupdate = "SELECT * FROM IdentifiedTab WHERE IdentifiedTab.[Jdid]=" + Jdid;
OleDbDataAdapter oda = new OleDbDataAdapter(strupdate, ocon);
DataTable dt = new DataTable();
oda.Fill(dt);
GridView1.DataSource = dt;
GridView1.DataBind();
switch (dt.Rows[0][7].ToString())
{
case "申请中":
break;
case "已接受":
LinkButton1(写在这里吗??????)
break;
}
------解决方案--------------------我晕死,“状态”字段我是举个例子,你写你实际的状态字段名
<asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="false"
&nbs