代码如下 我想判断companyyx为空怎么判断 小弟先谢谢
Dim add As String
Dim image As String
Dim dtr As SqlDataReader
Dim idd = Convert.ToString(Request.QueryString("BigClassName"))
Dim page = Convert.ToString(Request.QueryString("page"))
Dim ds As DataSet = New DataSet
Dim myconn As SqlConnection = New SqlConnection(ConfigurationSettings.AppSettings("connectionString"))
Dim adapter As SqlDataAdapter = New SqlDataAdapter("Select companyname,companyyx from CompanyContent where MlbigClassName='" & idd & "' and shenhe=0 order by times Desc", myconn)
adapter.Fill(ds, "Orders")
Dim pp As New PagedDataSource
pp.DataSource = ds.Tables("Orders").DefaultView
pp.AllowPaging = True
pp.PageSize = 20
Dim nPageCount As Integer '保存总共的数据页面数目
Dim a = ds.Tables("Orders").Rows.Count '保存记录总数
Dim nPage As Integer '存放要浏览当前数据页面号
If pp.PageCount Mod pp.PageSize > 0 Then
nPageCount = a \ pp.PageSize
nPageCount += 1
End If
nPage = Convert.ToInt32(Request.QueryString("Page"))
If Request.QueryString("Page") < 1 Then
nPage = 1
End If
If Request.QueryString("Page") > nPageCount Then
nPage = nPageCount
End If
pp.CurrentPageIndex = nPage - 1
'lblPageCount.Text = "总共" & a.ToString() + "条纪录"
page = (" " & "页次:" & nPage.ToString() & "/" & nPageCount.ToString())
page += (" <A HREF = """ & Request.CurrentExecutionFilePath & "?BigClassName=" & idd & "&page=" & (1).ToString() & """>首 页 </A >")
' If Not pp.IsFirstPage Then
page += (" <A HREF = """ & Request.CurrentExecutionFilePath & "?BigClassName=" & idd & "&page=" & Convert.ToString(nPage - 1) & """ >上一页</A > ")
' End If
' If Not pp.IsLastPage Then
page += ("<A HREF =""" & Request.CurrentExecutionFilePath & "?BigClassName=" & idd & "&page=" & Convert.ToString(nPage + 1) & """ >下一页</A > ")
' End If
page += ("<A HREF = """ & Request.CurrentExecutionFilePath & "?BigClassName=" & idd & "&page=" & (nPageCount).ToString() & """ >尾 页</A >") dstmsg.DataSource = pp
dstmsg.DataBind()
Dim add As String
Dim image As String
Dim dtr As SqlDataReader
Dim idd = Convert.ToString(Request.QueryString("BigClassName"))
Dim page = Convert.ToString(Request.QueryString("page"))
Dim ds As DataSet = New DataSet
Dim myconn As SqlConnection = New SqlConnection(ConfigurationSettings.AppSettings("connectionString"))
Dim adapter As SqlDataAdapter = New SqlDataAdapter("Select companyname,companyyx from CompanyContent where MlbigClassName='" & idd & "' and shenhe=0 order by times Desc", myconn)
adapter.Fill(ds, "Orders")
Dim pp As New PagedDataSource
pp.DataSource = ds.Tables("Orders").DefaultView
pp.AllowPaging = True
pp.PageSize = 20
Dim nPageCount As Integer '保存总共的数据页面数目
Dim a = ds.Tables("Orders").Rows.Count '保存记录总数
Dim nPage As Integer '存放要浏览当前数据页面号
If pp.PageCount Mod pp.PageSize > 0 Then
nPageCount = a \ pp.PageSize
nPageCount += 1
End If
nPage = Convert.ToInt32(Request.QueryString("Page"))
If Request.QueryString("Page") < 1 Then
nPage = 1
End If
If Request.QueryString("Page") > nPageCount Then
nPage = nPageCount
End If
pp.CurrentPageIndex = nPage - 1
'lblPageCount.Text = "总共" & a.ToString() + "条纪录"
page = (" " & "页次:" & nPage.ToString() & "/" & nPageCount.ToString())
page += (" <A HREF = """ & Request.CurrentExecutionFilePath & "?BigClassName=" & idd & "&page=" & (1).ToString() & """>首 页 </A >")
' If Not pp.IsFirstPage Then
page += (" <A HREF = """ & Request.CurrentExecutionFilePath & "?BigClassName=" & idd & "&page=" & Convert.ToString(nPage - 1) & """ >上一页</A > ")
' End If
' If Not pp.IsLastPage Then
page += ("<A HREF =""" & Request.CurrentExecutionFilePath & "?BigClassName=" & idd & "&page=" & Convert.ToString(nPage + 1) & """ >下一页</A > ")
' End If
page += ("<A HREF = """ & Request.CurrentExecutionFilePath & "?BigClassName=" & idd & "&page=" & (nPageCount).ToString() & """ >尾 页</A >") dstmsg.DataSource = pp
dstmsg.DataBind()
or
xx==dbnull.value