请教大家一个奇怪问题??
一段很普通的datagrid数据绑定代码,为什么在一个页面能显示数据,另一个页面却不显示数据呢?
代码如下:
Sub dbjh()
Dim conn As New OleDbConnection("provider=microsoft.jet.oledb.4.0;data source=" & Server.MapPath("../app_data/mydb.mdb"))
Dim str_xm As String
str_xm = Session("xm")
Dim strsql As String
strsql = "select * from tabjh where jhlct like ""*" & str_xm & "*"" and jhwc='否'"
Dim cmd As New OleDbCommand(strsql, conn)
conn.Open()
Dim dr As OleDbDataReader = cmd.ExecuteReader()
dg_jhdb.DataSource = dr
dg_jhdb.DataBind()
conn.Close()
End Sub