下面是关于该控件的基本使用代码,希望对大家有用 <%@ Page Language="VB" ContentType="text/html" ResponseEncoding="gb2312" %> <%@ import namespace="system.data"%> <%@ import namespace="system.data.sqlclient"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <script language="vb" runat="server"> sub page_load(sender as object,e as eventargs) dim cnn as sqlconnection dim cmd as sqlcommand dim html as string dim datar as sqldatareader ''''建立连接对象 cnn=new sqlconnection("server=LYWS;uid=sa;pwd=sa;database=book") cmd=new sqlcommand("select * from bookinfo",cnn) cmd.connection.open() ''''将结果集赋给datareader对象 datar=cmd.executereader() response.Write("<center><h2>图书信息表<h2><center>") response.Write("<center><table border=1 style=''''width:18cm''''>") response.Write("<tr>") response.Write("<th>图书代码</th>") response.Write("<th>图书名称</th>") response.Write("<th>出版社</th>") response.Write("<th>定价</th>") response.Write("<th>版别</th>") response.Write("<th>作者</th>") response.Write("</tr>")