?
Solved

build errors

Posted on 2007-07-23
5
Medium Priority
?
507 Views
Last Modified: 2012-05-05
VS2005 is intent of driving me insane!
After several changes to this web site and succesful builds and publishes it decides (once in a while) to refuse to run citing several warnings.
So....
Why is it inconsistent in reporting these errors? Why do warnings top it from building?
And most importantly what do these errors mean and how can I fix them?

1. Dim objCmd = New SqlCommand()
Warning Variable declaration without an 'As' clause; type of Object assumed.

2. Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.LoadWarning 6  sub 'Page_Load' shadows an overloadable member declared in the base class 'Admin_LatestUpdates_Updates'.  If you want to overload the base method, this method must be declared 'Overloads'.
0
Comment
Question by:QPR
  • 3
  • 2
5 Comments
 
LVL 48

Accepted Solution

by:
jpaulino earned 2000 total points
ID: 19551902
1.
You must declare your objCmd like Dim objCmd As SqlCommand = New SqlCommand()

2.
Have you duplicated the Page_Load event?
0
 
LVL 29

Author Comment

by:QPR
ID: 19551964
1. thanks
2. possibly!?
aspx has
<script language="VB" runat="server">
    Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
        If Page.IsPostBack Then
            Me.cal.Style.Add("display", "block")
        End If
    End Sub
</script>

aspx.vb has
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        txtTheDate.Text = System.DateTime.Now
    End Sub

is this invalid? how can i ifx?
0
 
LVL 48

Expert Comment

by:jpaulino
ID: 19551980
You must only have page_load event in aspx.vb not in aspx.

Move your code to the aspx.vb.
0
 
LVL 29

Author Comment

by:QPR
ID: 19552014
thanks I posted
If Page.IsPostBack Then
            Me.cal.Style.Add("display", "block")
End If

into the page_load sub in the aspx.vb and there are no "squiggles" under it.
Is the concept of postback still applicable in code behind?
0
 
LVL 48

Expert Comment

by:jpaulino
ID: 19552034
Yes, you can test it.
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Integration Management Part 2
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question