当前位置: 代码迷 >> ASP.NET >> 关于vs2003编译报错的有关问题
  详细解决方案

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

热度:8931   发布时间:2013-02-25 00:00:00.0
关于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
  相关解决方案