如何在网格的第一列中呈现超链接 [英] How to render a hyperlink in the first column of a grid

查看:104
本文介绍了如何在网格的第一列中呈现超链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Private Sub dataload()
        Dim i As Integer
        i = 0
        Dim constr As String = "Data Source=server2005;Initial Catalog=Databasename;User Id=userid;Password=password;Integrated Security=False"
        Dim objconnection As New SqlConnection(constr)
        objconnection.Open()
        Dim sqlstr As String = "SELECT NO AS REFNO,DATE,RONO,RODT,CLIENT,FDATE,TDATE,AMOUNT FROM ro07_08 ORDER BY DATE,CLIENT"
        Dim ds As New DataSet
        Dim da As SqlDataAdapter = New SqlDataAdapter(sqlstr, objconnection)
        da.Fill(ds, "ro07_08")
        If ds.Tables(0).Rows.Count = 0 Then Exit Sub
        dgv.DataSource = ds.Tables(0).DefaultView
        dgv.DataBind() '' dgv->gridview
        objconnection.Close()
        da.Dispose()
        da.Dispose()
        sqlstr = ""     
        
    End Sub



如何在第一栏中给出超链接?

Dim sqlstr As String = "SELECT NO AS REFNO,DATE,RONO,RODT,CLIENT,FDATE,TDATE,AMOUNT FROM ro07_08 ORDER BY DATE,CLIENT"




如果我单击refno(即第一列)如何打开下一页?
refno应该是第二页的参数.研究.不会的我认为没有一本没有解释该问题答案的ASP.NET书.

如果您是学生,为什么还要安装SQL Server 2005?如果您的代码需要付款,为什么会那么糟糕呢?我会解雇将SQL这样放在表示层中的任何人.如果他们对软件知之甚少,我什至不会给他们第二次机会.

aspx是您为数据网格定义模板的地方,而不是背后的代码.


Private Sub dataload()
        Dim i As Integer
        i = 0
        Dim constr As String = "Data Source=server2005;Initial Catalog=Databasename;User Id=userid;Password=password;Integrated Security=False"
        Dim objconnection As New SqlConnection(constr)
        objconnection.Open()
        Dim sqlstr As String = "SELECT NO AS REFNO,DATE,RONO,RODT,CLIENT,FDATE,TDATE,AMOUNT FROM ro07_08 ORDER BY DATE,CLIENT"
        Dim ds As New DataSet
        Dim da As SqlDataAdapter = New SqlDataAdapter(sqlstr, objconnection)
        da.Fill(ds, "ro07_08")
        If ds.Tables(0).Rows.Count = 0 Then Exit Sub
        dgv.DataSource = ds.Tables(0).DefaultView
        dgv.DataBind() '' dgv->gridview
        objconnection.Close()
        da.Dispose()
        da.Dispose()
        sqlstr = ""     
        
    End Sub



How to give hyperlink in first column?

Dim sqlstr As String = "SELECT NO AS REFNO,DATE,RONO,RODT,CLIENT,FDATE,TDATE,AMOUNT FROM ro07_08 ORDER BY DATE,CLIENT"




If i click refno(i.e first column) How to open next page?
refno should be parameter of second page..

解决方案

It seems to me like you just found this forum and you''re hoping it will act as a substitute for basic research. It won''t. I don''t think an ASP.NET book exists that does not explain the answer to this question.

If you''re a student, why do you have SQL Server 2005 ? If you''re being paid for your code, why is it so bad ? I''d fire anyone who put SQL in the presentation layer like this. I''d not even give them a second chance, if they knew that little about software.

The aspx is where you define the templates for your datagrid, not the code behind.


这篇关于如何在网格的第一列中呈现超链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆