【发布时间】:2013-12-03 13:57:33
【问题描述】:
我有这个页面 buscli.aspx
现在工作正常,griview 的来源是一个存储过程
string valorC = "%" + TextBox1.Text + "%"; numo = DropDownList1.SelectedValue;
switch (numo)
{
case "Nome": num3 = 1; break;
case "Endereço": num3 = 2; break ;
case "Telefone": num3 = 3 ; break;
case "Pedido": num3 = 4; break ;
}
SqlCommand cmd = new SqlCommand();
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "cazacliente2";
SqlParameter valor = new SqlParameter("@vbusca", SqlDbType.NVarChar);
SqlParameter num = new SqlParameter("@bo",SqlDbType.Int );
valor.Value = valorC ; num.Value = num3 ;
cmd.Parameters.Add(valor); cmd.Parameters.Add(num);
cmd.Connection = conex1;
try
{
GridView1.EmptyDataText = "Nao se" + numo.ToString() +"econtraron registros";
GridView1.DataSource = cmd.ExecuteReader();
GridView1.DataBind();
}
catch (Exception ex)
{ throw ex; }
finally
{
conex1.Close();
conex1.Dispose();
}
但现在我需要在超链接中转换 pedido 列,我看到了很多 youtube 示例,但都是数据集,我尝试了任何带有超链接字段的结果。
【问题讨论】:
标签: c# asp.net gridview hyperlink