Click here to Skip to main content
15,911,306 members
Home / Discussions / ASP.NET
   

ASP.NET

 
Questionhow to hide a textBox Pin
nannapanenikamalnath24-Aug-06 4:42
nannapanenikamalnath24-Aug-06 4:42 
AnswerRe: how to hide a textBox Pin
alexfromto24-Aug-06 5:17
alexfromto24-Aug-06 5:17 
Questioninconsistency in virtual dir Pin
Kunal P24-Aug-06 4:32
Kunal P24-Aug-06 4:32 
AnswerRe: inconsistency in virtual dir [modified] Pin
Guffa24-Aug-06 9:46
Guffa24-Aug-06 9:46 
GeneralRe: inconsistency in virtual dir Pin
Kunal P24-Aug-06 20:06
Kunal P24-Aug-06 20:06 
Questionhow hide a row Pin
nidheeshkayal24-Aug-06 4:29
nidheeshkayal24-Aug-06 4:29 
QuestionLoop returns wrong result Pin
playout24-Aug-06 4:19
playout24-Aug-06 4:19 
AnswerRe: Loop returns wrong result Pin
Brent Lamborn24-Aug-06 5:04
Brent Lamborn24-Aug-06 5:04 
It has something to do with recurrence. Each time it is called, another string is returned. Try this:

Public Shared Function getCompanyCode(ByVal strDivisionCode) As String

    Dim DivisionCode As String = strDivisionCode

    Dim ReturnedCompanyCode As String = ""
    Dim MyCompanyCode As String

    Dim CompanyCode As String = ""
    Dim CompanyLevel As String = ""

    Dim objConnSelectFloatSQL As SQLConnection = New SQLConnection(DB2TestConnectionString())
    Dim selectFloatSQL As String

    Try

        If DivisionCode <> "" Then

            'Level 4/5
            selectFloatSQL = "SELECT CompCode, CompNum from tblComp where CompNum = '" & DivisionCode.Trim() & "'"

            Dim objCmdSelectSQL As SQLCommand = New SQLCommand(selectFloatSQL, objConnSelectFloatSQL)

            objConnSelectFloatSQL.Open()

            Dim objDr As SQLDataReader = objCmdSelectSQL.ExecuteReader()
            While (objDr.Read())
                CompanyCode = objDr(0).ToString.Trim()
                CompanyLevel = objDr(1).ToString.Trim()
            End While
            objConnSelectFloatSQL.Close()


            MyCompanyCode = CompanyCode & "," & CompanyLevel

        Else
            MyCompanyCode = "LEVEL does not exist for:" & strDivisionCode
        End If

    Catch ex As Exception
        Dim strExceptionMsg As String = "Error Executing GetAS400InvoiceDetails(): " & ex.Message & "\r\n"
        Throw New Exception(strExceptionMsg, ex)

    Finally

        objConnSelectFloatSQL.Close()
    End Try

    Return MyCompanyCode

End Function


I return both the company code and level.

Then do this when you call it:

Dim FGBS1 as String = getCompanyCode(strDivisionCode)

while FGBS1.Substring(FGBS1.IndexOf(",") + 1) <> 3
   FGBS1 =getCompanyCode(strDivisionCode)
end while


It's not as elegant as using a recurring function, but I think doing something like this will solve your problem.
AnswerRe: Loop returns wrong result Pin
Paddy Boyd24-Aug-06 5:15
Paddy Boyd24-Aug-06 5:15 
QuestionPage Performance Pin
Amit Kumar G24-Aug-06 4:07
Amit Kumar G24-Aug-06 4:07 
QuestionWeb Site Installation Problem Pin
alexfromto24-Aug-06 3:32
alexfromto24-Aug-06 3:32 
QuestionRenamning Files Pin
kirthikirthi24-Aug-06 2:39
kirthikirthi24-Aug-06 2:39 
AnswerRe: Renamning Files Pin
coolestCoder24-Aug-06 3:48
coolestCoder24-Aug-06 3:48 
AnswerRe: Renamning Files Pin
Suresh Pirsquare24-Aug-06 3:52
Suresh Pirsquare24-Aug-06 3:52 
GeneralRe: Renamning Files Pin
kirthikirthi24-Aug-06 23:03
kirthikirthi24-Aug-06 23:03 
GeneralRe: Renamning Files Pin
_AK_24-Aug-06 23:06
_AK_24-Aug-06 23:06 
GeneralRe: Renamning Files Pin
Suresh Pirsquare24-Aug-06 23:54
Suresh Pirsquare24-Aug-06 23:54 
GeneralRe: Renamning Files Pin
Suresh Pirsquare24-Aug-06 23:57
Suresh Pirsquare24-Aug-06 23:57 
GeneralRe: Renamning Files [modified] Pin
Suresh Pirsquare25-Aug-06 0:01
Suresh Pirsquare25-Aug-06 0:01 
GeneralRe: Renamning Files Pin
kirthikirthi25-Aug-06 0:10
kirthikirthi25-Aug-06 0:10 
GeneralRe: Renamning Files [modified] Pin
Suresh Pirsquare25-Aug-06 0:26
Suresh Pirsquare25-Aug-06 0:26 
GeneralRe: Renamning Files Pin
kirthikirthi25-Aug-06 1:23
kirthikirthi25-Aug-06 1:23 
GeneralRe: Renamning Files Pin
Suresh Pirsquare25-Aug-06 1:43
Suresh Pirsquare25-Aug-06 1:43 
QuestionHow to count listbox items in codebehind when i add item using Javascript! Pin
Chetan.visodiya24-Aug-06 2:15
Chetan.visodiya24-Aug-06 2:15 
AnswerRe: How to count listbox items in codebehind when i add item using Javascript! Pin
alexfromto24-Aug-06 3:38
alexfromto24-Aug-06 3:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.