I know this error has been mentioned several times on this site, but i can't figure out what specifically i need to change in order to fix my code. 'LicenseID' is not being recognized when i run the following code...
Main page: default.aspx.vb
Public Class _Default
Inherits System.Web.UI.Page
Public Shared LicenseID As String
Public Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
LicenseID = Request.QueryString("LicenseID")
TextBox4.Text = LicenseID
End Sub
Public Sub ParseData_Click(sender As Object, e As EventArgs) Handles GetXML.Click
Dim XML As New GetXML
Dim ReturnMessage As String = ""
TextBox1.Text = XML.BuildStatus()
TextBox2.Text = XML.ReadData(LicenseID)
Dim RDR As New RawDataReader
End Sub
End Class
Here is the class that is having the issue (RawDataReader). The sub is ParseIT. Does anyone know where i need to move License ID? It does seem to be scoping issue.
Public Class RawDataReader
Inherits System.Web.UI.Page
Public Lic As RawData.License
Public msg As Object
Public Sub deserializexml(ByRef Path As String)
msg = "deserializeComplete"
Try
Dim s As New XmlSerializer(GetType(RawData.License))
Dim fs As New FileStream(Path, FileMode.Open)
Dim rdr As XmlReader = XmlReader.Create(fs)
Lic = CType(s.Deserialize(rdr), RawData.License)
fs.Close()
Catch ex As Exception
End Try
End Sub
Dim cn As Connection
Public Sub New()
cn = New Connection("Operations6")
End Sub
Public Sub ParseIT(LicenseID As String)
Try
msg = "deserializeComplete"
For Each itm In Lic.Products
cn.getScalar(" Exec LicenseUpsert " & _
"'" & LicenseID & "', " & _
"'" & itm.ProductName & "', " & _
"'" & itm.ExpiresOn & "'")
If Not Lic.Products(0) Is Nothing Then
With Lic.Products(0)
End With
End If
Next
Catch ex As Exception
msg = ex.ToString()
End Try
End Sub
End Class