首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

关于vs2003编译报错的有关问题

2012-04-28 
关于vs2003编译报错的问题我的应用是vb.net点击编译的时候,报错的文件是下面这个Safety_menu.aspx.vb报错

关于vs2003编译报错的问题

我的应用是vb.net

点击编译的时候,报错的文件是下面这个
Safety_menu.aspx.vb
报错的总结下来就是
sSQL和SQL_SUCCESS没有声明,
下面是关于这两段代码,不知道这东西在哪里声明,为什么编译的时候说没有声明?

VB.NET code
Public Class Safety_menu    Inherits System.Web.UI.Page    Protected WithEvents ImgMenuTitle As System.Web.UI.WebControls.Image    Protected WithEvents lblMenuTitle As System.Web.UI.WebControls.Label    Protected WithEvents spsData As FarPoint.Web.Spread.FpSpread    Protected WithEvents Mn As System.Web.UI.HtmlControls.HtmlGenericControl    Dim sMenuId As String    Private strTabMn As String    Protected ascPublic As ascPublic    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load        ascPublic = New ascPublic(Me)        If Not Page.IsPostBack Then            sMenuId = Request("MenuId")            If Trim(sMenuId) = "" Then                ImgMenuTitle.Visible = False                lblMenuTitle.Visible = False                lblMenuTitle.Text = ""            Else                ImgMenuTitle.Visible = True                lblMenuTitle.Visible = True                sSQL = ""                sSQL = sSQL & " Select menu_name From CMT_MENU " & vbCrLf                sSQL = sSQL & " Where menu_id = " & sMenuId

VB.NET code
            While ascPublic.RecordSet.Read                If rv = SQL_SUCCESS Then



[解决办法]
VB.NET code
Public Class Safety_menu    Inherits System.Web.UI.Page    Protected WithEvents ImgMenuTitle As System.Web.UI.WebControls.Image    Protected WithEvents lblMenuTitle As System.Web.UI.WebControls.Label    Protected WithEvents spsData As FarPoint.Web.Spread.FpSpread    Protected WithEvents Mn As System.Web.UI.HtmlControls.HtmlGenericControl    Dim sMenuId As String    Private strTabMn As String    Protected ascPublic As ascPublic    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load        ascPublic = New ascPublic(Me)        If Not Page.IsPostBack Then            sMenuId = Request("MenuId")            If Trim(sMenuId) = "" Then                ImgMenuTitle.Visible = False                lblMenuTitle.Visible = False                lblMenuTitle.Text = ""            Else                ImgMenuTitle.Visible = True                lblMenuTitle.Visible = True                Dim sSQL  As String                sSQL = ""                sSQL = sSQL & " Select menu_name From CMT_MENU " & vbCrLf                sSQL = sSQL & " Where menu_id = " & sMenuId
[解决办法]
Public Class Safety_menu
Inherits System.Web.UI.Page
Protected WithEvents ImgMenuTitle As System.Web.UI.WebControls.Image
Protected WithEvents lblMenuTitle As System.Web.UI.WebControls.Label
Protected WithEvents spsData As FarPoint.Web.Spread.FpSpread
Protected WithEvents Mn As System.Web.UI.HtmlControls.HtmlGenericControl
Dim sMenuId As String
'添加的 
Dim sSQL As String
Dim SQL_SUCCESS As String

Private strTabMn As String
Protected ascPublic As ascPublic

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ascPublic = New ascPublic(Me)
If Not Page.IsPostBack Then
sMenuId = Request("MenuId")

If Trim(sMenuId) = "" Then
ImgMenuTitle.Visible = False


lblMenuTitle.Visible = False
lblMenuTitle.Text = ""
Else
ImgMenuTitle.Visible = True
lblMenuTitle.Visible = True

sSQL = ""
sSQL = sSQL & " Select menu_name From CMT_MENU " & vbCrLf
sSQL = sSQL & " Where menu_id = " & sMenuId

热点排行