小弟的开发环境是vb.net中的asp.net web应用程序1、将编号列做成链接,不要用属性生成器哪种的或者模板裂哪种的,也不要在HTML里写的那种,就要在设计里写的纯代码那种昨天提问有人说用hyperlink或者buttonlink绑定值就可以了,但是在设计里如何写我真不太会,望兄弟们用代码质点一二。2、如何实现CheckBox被选中时,DataGrid显示相应的数据列,反之,不显示
CheckBox的autopostback设置true,触发事件里设置,但是如何设置还是不懂,望提供参考代码.3、查询后得到查询记录数的语句如何写?
这么写对吗?
Select Count(*) id, name From Tele
之后将上面语句赋给一个变量???

解决方案 »

  1.   

    select count(*) as counter from tb
      

  2.   

    http://dotnet.aspx.cc/ShowDetail.aspx?id=9EBB267B-E69D-460F-B4C7-BE08CA290C0F
      

  3.   

    http://dotnet.aspx.cc/ShowDetail.aspx?id=C0B53A2D-EF45-4E07-9C95-2849700F32A8
      

  4.   

    1、
    翻翻前面的帖子2、
    在CheckBox控件的事件里有一个CheckedChanged,双击后就可以写入代码。
    要注意的是IsPostBack的情况3、
    这句话的写法是要考虑一下的,Count()好像不适合和字段一起得出
      

  5.   

    Select Count(*) as Newname From Tele
    用getint32(0) 提取
      

  6.   

    Select Count(*) as Newname From Tele
    用getint32(0) 提取能不能写出来一个例子给我看看
      

  7.   

    CheckBox你只要设置他的AutoPostBack
      

  8.   

    CheckBox我是设置它的AutoPostBack了,但是选中后没有反应
    在触发事件里写什么代码呢?是不是下面的
           If Not IsPostBack Then
                Dim intCounter As Integer = 1
                For intCounter = 1 To MyDataGrid.Columns.Count - 1
                    MyDataGrid.Columns(intCounter).Visible = False
                Next
            End If
      

  9.   

    Select Count(*) as Newname From Tele
    用getint32(0) 提取能不能写出来一个例子给我看看
      

  10.   

    Select Count(*) as Newname From Tele
    用getint32(0) 提取能不能写出来一个例子给我看看吗?我没有写过,不会写,我太笨了,我知道的,可是没办法,帮帮忙了。
      

  11.   

    Select Count(*) as Newname From Tele
    用getint32(0) 提取能不能写出来一个全点的代码给我看看吗?我没有写过,不会写,我太笨了,我知道的,可是没办法,帮帮忙了。
      

  12.   

    SqlConnection connection = null;
    try
    {
    connection=new SqlConnection(ConfigurationSettings.AppSettings["ConnectionString"]);//创建数据库连接
    string userlogincheck="select count(*) from ta";//sql语句
    SqlParameter[] Ps=new SqlParameter[2];
    Ps[0] = new SqlParameter("@username", SqlDbType.VarChar,50);
    Ps[0].Value=p_username.Text.ToString();
    Ps[1] = new SqlParameter("@password", SqlDbType.VarChar,50);
    Ps[1].Value=p_password.Text.ToString();//创建参数并赋值
    object obj=SqlHelper.ExecuteScalar(connection,CommandType.Text,userlogincheck,Ps);//使用ExecuteScalar方法执行操作,返回第一行第一列
    if(obj!=null)
    {
    Response.Write((int)obj).ToString());

    }
    else
    {
    Response.Redirect("error.aspx");
    }

    }
    catch(Exception ex)
    {
    Response.Write(ex);
    }
    finally
    {
    if(connection != null)
    connection.Dispose();
    }
      

  13.   

    1、将编号列做成链接,不要用属性生成器哪种的或者模板裂哪种的,也不要在HTML里写的那种,就要在设计里写的纯代码那种昨天提问有人说用hyperlink或者buttonlink绑定值就可以了,但是在设计里如何写我真不太会,望兄弟们用代码质点一二。这个问题没人能回答我吗?
      

  14.   

    添加模板列
    TemplateColumn tc = new TemplateColumn();
    DataGird1.Columns.Add(tc); public void datagrid1_ItemDataBounded(object o,DataGridItemEventArgs e)
    {
       假设i列为模板  if(e.Item.ItemType==ListItemType.Item ||e.Item.ItemType==ListItemType.AlternateItem)
      {
             e.Item.Cell[i].Controls.Add(new hyperlink());
      }
       
    }
      

  15.   

    http://community.csdn.net/Expert/topic/3588/3588279.xml?temp=.8446619
      

  16.   

    datagrid没有ItemDataBounded这个事件呀???{
       假设i列为模板  if(e.Item.ItemType==ListItemType.Item ||e.Item.ItemType==ListItemType.AlternateItem)
      {
             e.Item.Cell[i].Controls.Add(new hyperlink());
      }
       
    }
    怎么将上面的代码改成asp.net呢?以前就遇到过了,自己没有改对。
      

  17.   

    1、将编号列做成链接,不要用属性生成器哪种的或者模板裂哪种的,也不要在HTML里写的那种,就要在设计里写的纯代码那种昨天提问有人说用hyperlink或者buttonlink绑定值就可以了,但是在设计里如何写我真不太会,望兄弟们用代码质点一二。