下邊兩個函數為何總是提示第二個中缺少end if 呢?
sub page_load(sender as object, e as eventargs)
if not ispostback then
dim conn as sqlconnection = new sqlconnection()
conn.connectionstring="Server=k987;Database=oa;Trusted_Connection=true"
conn.open()
else
response.Write("hello")
end if
end sub
sub saveclick(sender as object, e as System.Web.UI.ImageClickEventArgs)
if session("userid")="" then
dim conn as sqlconnection = new sqlconnection()
conn.connectionstring="Server=k987;Database=oa;Trusted_Connection=true"
conn.open()
dim sql as string
sql="insert into db_mynote(empid,content) values('"+session("userid")+"','"+txtcontent.text+"')"
dim cmd as sqlcommand= new sqlcommand(sql,conn)
cmd.executenonquery()
response.Redirect("mynote.aspx")
else
Response.Write("<script language='javascript'>window.open(Register.aspx','Target');</script>")
end if
end sub
sub page_load(sender as object, e as eventargs)
if not ispostback then
dim conn as sqlconnection = new sqlconnection()
conn.connectionstring="Server=k987;Database=oa;Trusted_Connection=true"
conn.open()
else
response.Write("hello")
end if
end sub
sub saveclick(sender as object, e as System.Web.UI.ImageClickEventArgs)
if session("userid")="" then
dim conn as sqlconnection = new sqlconnection()
conn.connectionstring="Server=k987;Database=oa;Trusted_Connection=true"
conn.open()
dim sql as string
sql="insert into db_mynote(empid,content) values('"+session("userid")+"','"+txtcontent.text+"')"
dim cmd as sqlcommand= new sqlcommand(sql,conn)
cmd.executenonquery()
response.Redirect("mynote.aspx")
else
Response.Write("<script language='javascript'>window.open(Register.aspx','Target');</script>")
end if
end sub
解决方案 »
- 用List作为Repeater数据源 前台怎么绑数据
- 请教关于进销存的帐务思路
- 读取Excel文件的数据
- 搜索问题
- 请各位高手帮帮忙哦
- 设置SqlDataAdapter的SelectCommand.Text为返回两个select结果的语句,那么填充dataset时会如何呢?
- 奇怪问题,不知大家有没有碰过,要如何解决!Request.QueryString("gg").ToString
- ~~水晶报表高人请进~~如何控制水晶报表只能预览,不能打印??
- 关于GridView
- 为何我安装了 Microsoft Visual Studio .NET 后发现没安装 Asp.net?
- 80分,请求解答
- 关于<%#....%>和<%="..."%>,
Register.aspx','Target');</script>")
//少了一个"'"