ini_mycontent.inc
来自「该软件是采用微软的.net技术编写的bbs论坛」· INC 代码 · 共 38 行
INC
38 行
<script language="VB" runat="server">
sub mycontent(id as string,flag as string) 'id为用户的id,flag=0是我提出的问题
if id="" or (not isnumeric(flag)) then 'flag=1是我参与的问题
exit sub
end if
dim strconn as string
strconn="server=localhost;uid=sa;pwd=chicken;database=mybbs" '注意密码
dim myconn as sqlconnection
myconn=new sqlconnection(strconn)
myconn.open()
dim myda as sqldataadapter
dim strsql as string
dim myds as dataset
dim mydview as dataview
if flag="1" then
strsql="select theme,sponsor as id,sponsetime as pup_time,content from main where sponsor='"
strsql+=id
strsql+="'"
myda=new sqldataadapter(strsql,myconn)
myda.fill(myds,"main")
mydview=myds.tables("main").defaultview
mydatagrid.datasource=mydview 'mydatagrid是调用的.inc中的datagrid的id
mydatagrid.databind()
else
strsql= "select main.theme as theme,follower.follower as id,follower.followtime as pup_time,follower.content from follower,main where follower.follower='"
strsql+=id
strsql+="'"
strsql+=" and main.num=follower.num"
myda=new sqldataadapter(strsql,myconn)
myda.fill(myds,"follower")
mydview=myds.tables("follower").defaultview
mydatagrid.datasource=mydview
mydatagrid.databind()
end if
myconn.close()
end sub
</script>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?