Click here to Skip to main content
15,907,905 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I have encountered an error at "Output" keyword as "Output is not declared" in this below code...
Someone please let me know how to solve this problem.
Thanks in advance.

harsha


XML
Imports AXMMCFGLib
Partial Class _Default
    Inherits System.Web.UI.Page
    Protected objMessageDB As XMessageDB
    Protected objMessage As XMessage
    Protected objConstants As XConstants
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        objMessageDB = New XMessageDB
        objConstants = New XConstants
        objMessageDB.Open()
        Dim output As New
        output.InnerHtml += "Open: ERROR #" & objMessageDB.LastError & _
                            " (" & objMessageDB.GetErrorDescription(objMessageDB.LastError) & ")"
        output.InnerHtml += "<BR><BR>"
        If (objMessageDB.LastError = 0) Then
            objMessage = objMessageDB.Create()
            output.InnerHtml += "Create: ERROR #" & objMessageDB.LastError & _
                                " (" & objMessageDB.GetErrorDescription(objMessageDB.LastError) & ")"
            output.InnerHtml += "<BR><BR>" & vbCrLf
            If (objMessageDB.LastError = 0) Then
                output.InnerHtml += "Message Created with ID: " & objMessage.ID
                output.InnerHtml += "<BR><BR>" & vbCrLf
                objMessage.Direction = objConstants.MESSAGEDIRECTION_OUT
                objMessage.Recipient = "+31647134225"
                objMessage.Status = objConstants.MESSAGESTATUS_PENDING
                objMessage.Type = objConstants.MESSAGETYPE_SMS
                objMessage.Body = "Message Created with ASP.NET(VB)"
                objMessageDB.Save(objMessage)
                output.InnerHtml += "Save: ERROR #" & objMessageDB.LastError & _
                                    " (" & objMessageDB.GetErrorDescription(objMessageDB.LastError) & ")"
                output.InnerHtml += "<BR><BR>" & vbCrLf
            End If
            objMessageDB.Close()
        End If
    End Sub
End Class
Posted
Updated 1-Apr-11 23:38pm
v2

Dim output As New
Perhaps if you specified what type output was supposed to be a new instance of, it would work better?
 
Share this answer
 
Comments
Fabio V Silva 2-Apr-11 4:37am    
Beat me to it :)
Harsha 2 2-Apr-11 4:51am    
That's what iam looking for....
Please tell me with what type the output can be declared.
OriginalGriff 2-Apr-11 6:01am    
I can't: It's your program! What kind of object is it supposed to be? :laugh:
Sergey Alexandrovich Kryukov 4-Apr-11 23:08pm    
Griff, I'm asking you, why did you fail to read OP's mind? (Maybe, there is no much to read on this topic?) Well, a 5.
--SA
Aren't you getting an error on the line
Dim output As New
?
 
Share this answer
 
Comments
Harsha 2 2-Apr-11 4:51am    
That's what iam looking for.... Please tell me with what type the output can be declared.
Fabio V Silva 2-Apr-11 4:58am    
You can declare it anything you want or need, that's the beauty of programming...

On a more serious note, you should know what you are looking for, you are using its InnerHTML property...
Dalek Dave 2-Apr-11 7:56am    
Good Call
Sergey Alexandrovich Kryukov 4-Apr-11 23:09pm    
5 just for comment about the beauty of programming. (And the question has no point anyway...)
--SA
Don't post the same question twice!

You OBVIOUSLY copied this code from somewhere because you have no idea what it does or how it works. Where did you copy the code from??
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 4-Apr-11 23:06pm    
Yes, it looks like...
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900