Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Compiler Error Message: BC30451 Name "variablename" is not declared

Status
Not open for further replies.

Ryderson

Programmer
Mar 27, 2007
4
US
Using VB 2005 with .net 2.0 framework.

I am getting this compiler error nad I cannot figure out what in the world is wrong with my webpage. The page works fine until I try and rebuild it in release mode. I'm receiving 47 errors which all same the same thing for each variable. But not all the textboxes with the same identical setup are giving fits, just the ones variables and textboxes that I have recently added.

C:\WebBatsApp 2.0\WebBatsApp\CASEMGMT\Financial\CMSearchSardCtl.ascx.vb(138,0): error BC30451: Name 'txtSpecialCouncilHimself' is not declared.

My code looks like this:

Private Sub GetSard()
Dim SpecialCouncilHimself as string
For Each Row1 In ds.Tables("BaSard").Rows
SpecialCouncilHimself = CDbl(IIf(IsDBNull(Row1 ("SpecialCouncil")), 0.0, Row1("SpecialCouncil")))
Next
End Sub

The line(s) with the errors are this:
txtSpecialCouncil.Text = SpecialCouncil.ToString("C")

I have deleted the bin files and tried to rebuild but still same errors. Can anybody tell me where to begin looking?
 
Your code is all over the place. Your error message references 'txtSpecialCouncilHimself', but I don't see that in your code anywhere. Then this line:

txtSpecialCouncil.Text = SpecialCouncil.ToString("C")

is it related to the other code in some way? I can see where you defined a variable called SpecialCouncilHimself, but where does SpecialCouncil come from?


I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson

Arrrr, mateys! Ye needs ta be preparin' yerselves fer Talk Like a Pirate Day!
 
Sorry, I was trying to post only relevant info and pasted wrong info. Here is the a better paste of the sub in question:

Imports System
Imports System.Configuration
Imports System.Data
Imports System.Data.SqlClient
Imports WebBATSApp
Public Class CMSearchSardCtl
Inherits System.Web.UI.UserControl

Private ez As EZFormat_ASP.EZSQL Private BaCaseID, BaSardID As Int32
Private AddEdit As String

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load, Me.Load ez = New EZFormat_ASP.EZSQL(BaMod.BaConnectionString)

If Not Page.IsPostBack Then
Try
GetSard()
Me.txtGrossRcpts.Focus()
Catch ex As Exception
BaMod.LogAppError(ez, Now, "CMSearchSardCtl", "Page_Load", ex.ToString, BaMod.ErrSeverity.Low)
End Try
End If
End Sub

#Region "GetSard"

Private Sub GetSard()
BaCaseID = CInt(Session("CaseID"))
Dim BaSardID As Int32
Dim cmd As SqlCommand = Nothing
ez.ExecuteNonQuery("spFindBaSardByID", cmd, BaCaseID)
BaSardID = CInt(cmd.Parameters.Item(0).Value)
Dim ds As New DataSetDim db As New WebBATS.GetDataSet(ez)
Dim CancelChecks, ZeroBalance, DistributionProper, UnclaimedFunds, DividendsLess5, MaxComp As Int32
Dim GrossRcpts, TrusteeComp, TrusteeExpenses, TrustAttyFee, TrustAttyFeeHimself, SpecialCouncil, _
AccountantFee, AuctioneerFee, AppraiserFee, LiquidatorFee, RealtorFee, OthProfFee, OtherPay, _
DbPayments, SecuredClaims, PriorityClaims As Double

Dim SpecialCouncilHimself, UnsecuredClaimsTimely, UnsecuredClaimsLate, AllowableUnsecuredTimely, _
AllowableUnsecuredLate, InterestPaidOnClaim, ClosingCosts As Double

Dim AssetCategory, AssetDescription As String

Try
Dim p As New SqlParameter("@BaCaseID", SqlDbType.BigInt)
p.Value = BaCaseID
Dim Col As New Collection
Col.Add(p)
If BaSardID <> 0 Then
db.GetDsSardByID(BaCaseID)
db.da.Fill(ds, "BaSard")
If ds.Tables.Count > 0 Then
lblHeading.Text = "Edit SARD Data"
Dim Row1 As DataRow
For Each Row1 In ds.Tables("BaSard").Rows
Session("BaSardID") = CInt(Row1.Item("BaSardID"))
GrossRcpts = CDbl(IIf(IsDBNull(Row1("GrossRcpts")), 0.0, Row1("GrossRcpts")))
TrusteeComp = CDbl(IIf(IsDBNull(Row1("TrusteeComp")), 0.0, Row1("TrusteeComp")))
TrusteeExpenses = CDbl(IIf(IsDBNull(Row1("TrusteeExpenses")), 0.0, Row1("TrusteeExpenses")))
TrustAttyFee = CDbl(IIf(IsDBNull(Row1("TrustAttyFee")), 0.0, Row1("TrustAttyFee")))
TrustAttyFeeHimself = CDbl(IIf(IsDBNull(Row1("TrustAttyFeeHimself")), 0.0, Row1("TrustAttyFeeHimself")))
SpecialCouncil = CDbl(IIf(IsDBNull(Row1("SpecialCouncil")), 0.0, Row1("SpecialCouncil")))
SpecialCouncilHimself = CDbl(IIf(IsDBNull(Row1("SpecialCouncil")), 0.0, Row1("SpecialCouncil")))
AccountantFee = CDbl(IIf(IsDBNull(Row1("AccountantFee")), 0.0, Row1("AccountantFee")))
AppraiserFee = CDbl(IIf(IsDBNull(Row1("AppraiserFee")), 0.0, Row1("AppraiserFee")))
AuctioneerFee = CDbl(IIf(IsDBNull(Row1("AuctioneerFee")), 0.0, Row1("AuctioneerFee")))
LiquidatorFee = CDbl(IIf(IsDBNull(Row1("LiquidatorFee")), 0.0, Row1("LiquidatorFee")))
RealtorFee = CDbl(IIf(IsDBNull(Row1("RealtorFee")), 0.0, Row1("RealtorFee")))
OthProfFee = CDbl(IIf(IsDBNull(Row1("OthProfFee")), 0.0, Row1("OthProfFee")))
PriorityClaims = CDbl(IIf(IsDBNull(Row1("PriorityClaims")), 0.0, Row1("PriorityClaims")))
SecuredClaims = CDbl(IIf(IsDBNull(Row1("SecuredClaims")), 0.0, Row1("SecuredClaims")))
UnsecuredClaimsTimely = CDbl(IIf(IsDBNull(Row1("UnsecuredClaimsTimely")), 0.0, Row1("UnsecuredClaimsTimely")))
UnsecuredClaimsLate = CDbl(IIf(IsDBNull(Row1("UnsecuredClaimsLate")), 0.0, Row1("UnsecuredClaimsLate")))
AllowableUnsecuredTimely = CDbl(IIf(IsDBNull(Row1("AllowableUnsecuredTimely")), 0.0, Row1("AllowableUnsecuredTimely")))
AllowableUnsecuredLate = CDbl(IIf(IsDBNull(Row1("AllowableUnsecuredLate")), 0.0, Row1("AllowableUnsecuredLate")))
InterestPaidOnClaim = CDbl(IIf(IsDBNull(Row1("InterestPaidOnClaim")), 0.0, Row1("InterestPaidOnClaim")))
DbPayments = CDbl(IIf(IsDBNull(Row1("DbPayments")), 0.0, Row1("DbPayments")))
ClosingCosts = CDbl(IIf(IsDBNull(Row1("ClosingCosts")), 0.0, Row1("ClosingCosts")))
OtherPay = CDbl(IIf(IsDBNull(Row1("OtherPay")), 0.0, Row1("OtherPay")))
CancelChecks = CInt(IIf(IsDBNull(Row1("CancelChecks")), 0, Row1("CancelChecks")))
ZeroBalance = CInt(IIf(IsDBNull(Row1("ZeroBalance")), 0, Row1("ZeroBalance")))
DistributionProper = CInt(IIf(IsDBNull(Row1("DistributionProper")), 0.0, Row1("DistributionProper")))
UnclaimedFunds = CInt(IIf(IsDBNull(Row1("UnclaimedFunds")), 0, Row1("UnclaimedFunds")))
DividendsLess5 = CInt(IIf(IsDBNull(Row1("DividendsLess5")), 0, Row1("DividendsLess5")))
AssetCategory = CStr(IIf(IsDBNull(Row1("AssetCategory")), "", Row1("AssetCategory")))
AssetDescription = CStr(IIf(IsDBNull(Row1("AssetDescription")), "", Row1("AssetDescription")))
MaxComp = CInt(IIf(IsDBNull(Row1("MaxComp")), 0, Row1("MaxComp")))
Next
End If

Else

lblHeading.Text = "Add SARD Data"
GrossRcpts = 0.0
TrusteeComp = 0.0
TrusteeExpenses = 0.0
TrustAttyFee = 0.0
TrustAttyFeeHimself = 0.0
SpecialCouncil = 0.0
SpecialCouncilHimself = 0.0
AccountantFee = 0.0
AuctioneerFee = 0.0
AppraiserFee = 0.0
LiquidatorFee = 0.0
RealtorFee = 0.0
OthProfFee = 0.0
OtherPay = 0.0
DbPayments = 0.0
ClosingCosts = 0.0
SecuredClaims = 0.0
PriorityClaims = 0.0
UnsecuredClaimsTimely = 0.0
UnsecuredClaimsLate = 0.0
AllowableUnsecuredTimely = 0.0
AllowableUnsecuredLate = 0.0
InterestPaidOnClaim = 0.0
CancelChecks = 0
ZeroBalance = 0
DistributionProper = 0
UnclaimedFunds = 0
DividendsLess5 = 0
MaxComp = 0

End If

txtGrossRcpts.Text = GrossRcpts.ToString("C")
txtTrusteeComp.Text = TrusteeComp.ToString("C")
txtTrusteeExpenses.Text = TrusteeExpenses.ToString("C")
txtTrustAttyFee.Text = TrustAttyFee.ToString("C")
txtTrustAttyHimself.Text = TrustAttyFeeHimself.ToString("C")
txtSpecialCouncil.Text = SpecialCouncil.ToString("C")
txtSpecialCouncilHimself.Text = SpecialCouncilHimself.ToString("C")
txtAppraiserFee.Text = AppraiserFee.ToString("C")
txtAccountantFee.Text = AccountantFee.ToString("C")
txtAuctioneerFee.Text = AuctioneerFee.ToString("C")
txtLiquidatorFee.Text = LiquidatorFee.ToString("C")
txtRealtorFee.Text = RealtorFee.ToString("C")
txtOthProfFee.Text = OthProfFee.ToString("C")
txtPriorityClaims.Text = PriorityClaims.ToString("C")
txtSecuredClaims.Text = SecuredClaims.ToString("C")
txtUnsecuredClaimsTimely.Text = UnsecuredClaimsTimely.ToString("C")
txtUnsecuredClaimsLate.Text = UnsecuredClaimsLate.ToString("C")
txtAllowableUnsecuredTimely.Text = AllowableUnsecuredTimely.ToString("c")
txtAllowableUnsecuredLate.Text = AllowableUnsecuredLate.ToString("c")
txtInterestPaidOnClaim.Text = InterestPaidOnClaim.ToString("c")
txtdbpayments.Text = DbPayments.ToString("C")
txtClosingCosts.Text = ClosingCosts.ToString("C")
txtOtherPay.Text = OtherPay.ToString("C")
If MaxComp = 0 Then
Me.rbMaxCompNo.Checked = True
Else
Me.rbMaxCompYes.Checked = True
End If
If CancelChecks = 0 Then
rbCancelChecksNo.Checked = True
Else
rbCancelChecksYes.Checked = True
End If
If ZeroBalance = 0 Then
rbZeroBalanceNo.Checked = True
Else
rbZeroBalanceYes.Checked = True
End If
If DistributionProper = 0 Then
rbDistribProperNo.Checked = True
Else
rbDistribProperYes.Checked = True
End If
If UnclaimedFunds = 0 Then
rbUnclaimedFundsNo.Checked = True
Else
rbUnclaimedFundsYes.Checked = True
End If
If DividendsLess5 = 0 Then
rbDividendsLess5No.Checked = True
Else
rbDividendsLess5Yes.Checked = True
End If
Me.ddlAssetCategory.SelectedValue = AssetCategory
Me.AssetDescription.Text = AssetDescription
Catch ex As Exception BaMod.LogAppError(ez, Now, "CMSearchSardCtl", "GetSard", ex.ToString, BaMod.ErrSeverity.Low)
End Try

End Sub

#End Region

End Class
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top