网
网络无限
Unregistered / Unconfirmed
GUEST, unregistred user!
我有一个数据库(ip.mdb),里面有数据表(ip),表里面有字段名为ip的字段,我让数据库里面的ip显示在标签label里面,代码如下:
<%@ Page Language="VB"
ContentType="text/html"
ResponseEncoding="gb2312"
%>
<%@Import Namespace="System.Data"%>
<%@Import Namespace="System.Data.OleDb"%>
<form runat="server">
<asp:Label ID="oicq"
runat="server"
/>
<%
dim objConnection as OleDbConnection
dim objCommand as OleDbCommand
dim objDataReader as OleDbDataReader
objConnection=new OleDbConnection("Provider=Microsoft.Jet.OleDb.4.0;Data Source="+Server.MapPath("ip.mdb")
objCommand=new OleDbCommand("select top 1 * from ip"
, objConnection)
objConnection.Open()
objDataReader=objCommand.ExecuteReader()
if objDataReader.Read then
oicq.Text=Convert.ToString(objDataReader["ip"])
end if
%>
</form>
浏览时提示这句不对(oicq.Text=Convert.ToString(objDataReader["ip"]))
Compiler Error Message: BC30203: Identifier expected.
后经过试验,我认为问题出在objDataReader["ip"],请问问题是在这里吗,如何解决,谢谢
<%@ Page Language="VB"
ContentType="text/html"
ResponseEncoding="gb2312"
%>
<%@Import Namespace="System.Data"%>
<%@Import Namespace="System.Data.OleDb"%>
<form runat="server">
<asp:Label ID="oicq"
runat="server"
/>
<%
dim objConnection as OleDbConnection
dim objCommand as OleDbCommand
dim objDataReader as OleDbDataReader
objConnection=new OleDbConnection("Provider=Microsoft.Jet.OleDb.4.0;Data Source="+Server.MapPath("ip.mdb")
objCommand=new OleDbCommand("select top 1 * from ip"
, objConnection)
objConnection.Open()
objDataReader=objCommand.ExecuteReader()
if objDataReader.Read then
oicq.Text=Convert.ToString(objDataReader["ip"])
end if
%>
</form>
浏览时提示这句不对(oicq.Text=Convert.ToString(objDataReader["ip"]))
Compiler Error Message: BC30203: Identifier expected.
后经过试验,我认为问题出在objDataReader["ip"],请问问题是在这里吗,如何解决,谢谢