473,403 Members | 2,354 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

code runs but don't work?

Why this code is not working? I think the problem is in the business class
code.when I select a state from the dropdownlist, the school dropdownlist
suppose
to fill with school names, but somehow the state value is not getting back
to the business class. I think it's the way I'm using property get and set
accessor function.
****My Business Class------------
' Private variables
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
Private Shared myStateID As String

Public Shared Function GetSchoolByState(ByVal StateID As String) As DataSet
myStateID = StateID
Dim tool As New StuLotto.Accounts.Data.AccountsTool
Return tool.GetSchoolByStateList(myStateID)
End Function

' Properties
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
Public Property StateID() As String
Get
Return myStateID
End Get
Set(ByVal value As String)
myStateID = value
End Set
End Property
****My CodeBehind Class----------------
' Bind the school by selected state drop-down combobox
Private Sub SStateDDL_SelectedIndexChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
SStateDDL.SelectedIndexChanged
Dim Schools As New DataSet
Dim Value As String = SStateDDL.SelectedItem.Value
Schools = Accounts.Business.AccountsTool.GetSchoolByState(Va lue)
SNameDDL.DataSource = Schools
SNameDDL.DataTextField = "SchoolName"
SNameDDL.DataValueField = "SchoolID"
SNameDDL.DataBind()
End Sub
Nov 18 '05 #1
13 1118
I don't see the property StateID called anywhere in your sniplet...

/mortb
"Leon" <vn*****@msn.com> wrote in message
news:ee**************@TK2MSFTNGP12.phx.gbl...
Why this code is not working? I think the problem is in the business class
code.when I select a state from the dropdownlist, the school dropdownlist
suppose
to fill with school names, but somehow the state value is not getting back
to the business class. I think it's the way I'm using property get and set
accessor function.
****My Business Class------------
' Private variables
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- -
Private Shared myStateID As String

Public Shared Function GetSchoolByState(ByVal StateID As String) As
DataSet
myStateID = StateID
Dim tool As New StuLotto.Accounts.Data.AccountsTool
Return tool.GetSchoolByStateList(myStateID)
End Function

' Properties
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- -
Public Property StateID() As String
Get
Return myStateID
End Get
Set(ByVal value As String)
myStateID = value
End Set
End Property
****My CodeBehind Class----------------
' Bind the school by selected state drop-down combobox
Private Sub SStateDDL_SelectedIndexChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
SStateDDL.SelectedIndexChanged
Dim Schools As New DataSet
Dim Value As String = SStateDDL.SelectedItem.Value
Schools = Accounts.Business.AccountsTool.GetSchoolByState(Va lue)
SNameDDL.DataSource = Schools
SNameDDL.DataTextField = "SchoolName"
SNameDDL.DataValueField = "SchoolID"
SNameDDL.DataBind()
End Sub

Nov 18 '05 #2
How do I fix that problem?

"mortb" <mortb1<noospam<@hotmail.com> wrote in message
news:eD**************@TK2MSFTNGP15.phx.gbl...
I don't see the property StateID called anywhere in your sniplet...

/mortb
"Leon" <vn*****@msn.com> wrote in message
news:ee**************@TK2MSFTNGP12.phx.gbl...
Why this code is not working? I think the problem is in the business
class
code.when I select a state from the dropdownlist, the school dropdownlist
suppose
to fill with school names, but somehow the state value is not getting
back
to the business class. I think it's the way I'm using property get and
set
accessor function.
****My Business Class------------
' Private variables

'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- -
Private Shared myStateID As String

Public Shared Function GetSchoolByState(ByVal StateID As String) As
DataSet
myStateID = StateID
Dim tool As New StuLotto.Accounts.Data.AccountsTool
Return tool.GetSchoolByStateList(myStateID)
End Function

' Properties

'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- -
Public Property StateID() As String
Get
Return myStateID
End Get
Set(ByVal value As String)
myStateID = value
End Set
End Property
****My CodeBehind Class----------------
' Bind the school by selected state drop-down combobox
Private Sub SStateDDL_SelectedIndexChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
SStateDDL.SelectedIndexChanged
Dim Schools As New DataSet
Dim Value As String = SStateDDL.SelectedItem.Value
Schools = Accounts.Business.AccountsTool.GetSchoolByState(Va lue)
SNameDDL.DataSource = Schools
SNameDDL.DataTextField = "SchoolName"
SNameDDL.DataValueField = "SchoolID"
SNameDDL.DataBind()
End Sub


Nov 18 '05 #3
Leon wrote:
Why this code is not working? I think the problem is in the business
class code.when I select a state from the dropdownlist, the school
dropdownlist suppose
to fill with school names, but somehow the state value is not getting
back to the business class. I think it's the way I'm using property
get and set accessor function.
****My Business Class------------
' Private variables
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
Private Shared myStateID As String

Public Shared Function GetSchoolByState(ByVal StateID As String) As
DataSet myStateID = StateID
Dim tool As New StuLotto.Accounts.Data.AccountsTool
Return tool.GetSchoolByStateList(myStateID)
End Function

' Properties
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
Public Property StateID() As String
Get
Return myStateID
End Get
Set(ByVal value As String)
myStateID = value
End Set
End Property
****My CodeBehind Class----------------
' Bind the school by selected state drop-down combobox
Private Sub SStateDDL_SelectedIndexChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
SStateDDL.SelectedIndexChanged
Dim Schools As New DataSet
Dim Value As String = SStateDDL.SelectedItem.Value
Schools = Accounts.Business.AccountsTool.GetSchoolByState(Va lue)
SNameDDL.DataSource = Schools SNameDDL.DataTextField = "SchoolName" SNameDDL.DataValueField = "SchoolID"
SNameDDL.DataBind()
End Sub


When you debug this code, what is returned by the various "GetSchool"
methods? Are you sure the correct "state" value is supplied?

The property you mention is never used (in your published code).
The "StateID" in the first method is a local variable.

Hans Kesting
Nov 18 '05 #4
nothing is returned. I also change my code to the following and it does not
work, but compile errors.

' Bind the school by selected state drop-down combobox

Private Sub SStateDDL_SelectedIndexChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles SStateDDL.SelectedIndexChanged

Dim Schools As New DataSet

Dim Value As String = Accounts.Business.AccountsTool.StateID =
SStateDDL.SelectedItem.Value.ToString

Schools = Accounts.Business.AccountsTool.GetSchoolByState(Va lue)

SNameDDL.DataSource = Schools

SNameDDL.DataTextField = "SchoolName"

SNameDDL.DataValueField = "SchoolID"

SNameDDL.DataBind()

End Sub

"Hans Kesting" <ne***********@spamgourmet.com> wrote in message
news:O6*************@TK2MSFTNGP14.phx.gbl...
Leon wrote:
Why this code is not working? I think the problem is in the business
class code.when I select a state from the dropdownlist, the school
dropdownlist suppose
to fill with school names, but somehow the state value is not getting
back to the business class. I think it's the way I'm using property
get and set accessor function.
****My Business Class------------
' Private variables
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
Private Shared myStateID As String

Public Shared Function GetSchoolByState(ByVal StateID As String) As
DataSet myStateID = StateID
Dim tool As New StuLotto.Accounts.Data.AccountsTool
Return tool.GetSchoolByStateList(myStateID)
End Function

' Properties
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
Public Property StateID() As String
Get
Return myStateID
End Get
Set(ByVal value As String)
myStateID = value
End Set
End Property
****My CodeBehind Class----------------
' Bind the school by selected state drop-down combobox
Private Sub SStateDDL_SelectedIndexChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
SStateDDL.SelectedIndexChanged
Dim Schools As New DataSet
Dim Value As String = SStateDDL.SelectedItem.Value
Schools = Accounts.Business.AccountsTool.GetSchoolByState(Va lue)
SNameDDL.DataSource = Schools SNameDDL.DataTextField =
"SchoolName" SNameDDL.DataValueField = "SchoolID"
SNameDDL.DataBind()
End Sub


When you debug this code, what is returned by the various "GetSchool"
methods? Are you sure the correct "state" value is supplied?

The property you mention is never used (in your published code).
The "StateID" in the first method is a local variable.

Hans Kesting

Nov 18 '05 #5
Problem? It may not be a problem. It depends on what you want to do.
The funciton GetSchoolByState(ByVal StateID As String)
takes a StateID and sets the private variable myStateID. The get/set
accessor is never called in your example but may be somewhere else in your
program.
You should debug and see what is passed into GetSchoolByState.
If the right value is passed the problem lies in the function
GetSchoolByState calls.

cheers,
mortb

"Leon" <vn*****@msn.com> wrote in message
news:ul**************@TK2MSFTNGP14.phx.gbl...
How do I fix that problem?

"mortb" <mortb1<noospam<@hotmail.com> wrote in message
news:eD**************@TK2MSFTNGP15.phx.gbl...
I don't see the property StateID called anywhere in your sniplet...

/mortb
"Leon" <vn*****@msn.com> wrote in message
news:ee**************@TK2MSFTNGP12.phx.gbl...
Why this code is not working? I think the problem is in the business
class
code.when I select a state from the dropdownlist, the school
dropdownlist suppose
to fill with school names, but somehow the state value is not getting
back
to the business class. I think it's the way I'm using property get and
set
accessor function.
****My Business Class------------
' Private variables
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- -
Private Shared myStateID As String

Public Shared Function GetSchoolByState(ByVal StateID As String) As
DataSet
myStateID = StateID
Dim tool As New StuLotto.Accounts.Data.AccountsTool
Return tool.GetSchoolByStateList(myStateID)
End Function

' Properties
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- -
Public Property StateID() As String
Get
Return myStateID
End Get
Set(ByVal value As String)
myStateID = value
End Set
End Property
****My CodeBehind Class----------------
' Bind the school by selected state drop-down combobox
Private Sub SStateDDL_SelectedIndexChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
SStateDDL.SelectedIndexChanged
Dim Schools As New DataSet
Dim Value As String = SStateDDL.SelectedItem.Value
Schools = Accounts.Business.AccountsTool.GetSchoolByState(Va lue)
SNameDDL.DataSource = Schools
SNameDDL.DataTextField = "SchoolName"
SNameDDL.DataValueField = "SchoolID"
SNameDDL.DataBind()
End Sub



Nov 18 '05 #6
How do you know the get/set accessor is never called?
"mortb" <mortb1<noospam<@hotmail.com> wrote in message
news:uR**************@TK2MSFTNGP15.phx.gbl...
Problem? It may not be a problem. It depends on what you want to do.
The funciton GetSchoolByState(ByVal StateID As String)
takes a StateID and sets the private variable myStateID. The get/set
accessor is never called in your example but may be somewhere else in your
program.
You should debug and see what is passed into GetSchoolByState.
If the right value is passed the problem lies in the function
GetSchoolByState calls.

cheers,
mortb

"Leon" <vn*****@msn.com> wrote in message
news:ul**************@TK2MSFTNGP14.phx.gbl...
How do I fix that problem?

"mortb" <mortb1<noospam<@hotmail.com> wrote in message
news:eD**************@TK2MSFTNGP15.phx.gbl...
I don't see the property StateID called anywhere in your sniplet...

/mortb
"Leon" <vn*****@msn.com> wrote in message
news:ee**************@TK2MSFTNGP12.phx.gbl...
Why this code is not working? I think the problem is in the business
class
code.when I select a state from the dropdownlist, the school
dropdownlist suppose
to fill with school names, but somehow the state value is not getting
back
to the business class. I think it's the way I'm using property get and
set
accessor function.
****My Business Class------------
' Private variables

'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- -
Private Shared myStateID As String

Public Shared Function GetSchoolByState(ByVal StateID As String) As
DataSet
myStateID = StateID
Dim tool As New StuLotto.Accounts.Data.AccountsTool
Return tool.GetSchoolByStateList(myStateID)
End Function

' Properties

'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- -
Public Property StateID() As String
Get
Return myStateID
End Get
Set(ByVal value As String)
myStateID = value
End Set
End Property
****My CodeBehind Class----------------
' Bind the school by selected state drop-down combobox
Private Sub SStateDDL_SelectedIndexChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
SStateDDL.SelectedIndexChanged
Dim Schools As New DataSet
Dim Value As String = SStateDDL.SelectedItem.Value
Schools = Accounts.Business.AccountsTool.GetSchoolByState(Va lue)
SNameDDL.DataSource = Schools
SNameDDL.DataTextField = "SchoolName"
SNameDDL.DataValueField = "SchoolID"
SNameDDL.DataBind()
End Sub



Nov 18 '05 #7
then we would see
string X = Accounts.Business.AccountsTool.StateID
or
Accounts.Business.AccountsTool.StateID = "foo"
in your codebehind code

"Leon" <vn*****@msn.com> wrote in message
news:OY**************@TK2MSFTNGP09.phx.gbl...
How do you know the get/set accessor is never called?
"mortb" <mortb1<noospam<@hotmail.com> wrote in message
news:uR**************@TK2MSFTNGP15.phx.gbl...
Problem? It may not be a problem. It depends on what you want to do.
The funciton GetSchoolByState(ByVal StateID As String)
takes a StateID and sets the private variable myStateID. The get/set
accessor is never called in your example but may be somewhere else in
your program.
You should debug and see what is passed into GetSchoolByState.
If the right value is passed the problem lies in the function
GetSchoolByState calls.

cheers,
mortb

"Leon" <vn*****@msn.com> wrote in message
news:ul**************@TK2MSFTNGP14.phx.gbl...
How do I fix that problem?

"mortb" <mortb1<noospam<@hotmail.com> wrote in message
news:eD**************@TK2MSFTNGP15.phx.gbl...
I don't see the property StateID called anywhere in your sniplet...

/mortb
"Leon" <vn*****@msn.com> wrote in message
news:ee**************@TK2MSFTNGP12.phx.gbl...
> Why this code is not working? I think the problem is in the business
> class
> code.when I select a state from the dropdownlist, the school
> dropdownlist suppose
> to fill with school names, but somehow the state value is not getting
> back
> to the business class. I think it's the way I'm using property get and
> set
> accessor function.
>
>
> ****My Business Class------------
> ' Private variables
>
>
>
>
> '- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> -
> - -
> Private Shared myStateID As String
>
> Public Shared Function GetSchoolByState(ByVal StateID As String) As
> DataSet
> myStateID = StateID
> Dim tool As New StuLotto.Accounts.Data.AccountsTool
> Return tool.GetSchoolByStateList(myStateID)
> End Function
>
> ' Properties
>
>
>
>
> '- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> -
> - -
> Public Property StateID() As String
> Get
> Return myStateID
> End Get
> Set(ByVal value As String)
> myStateID = value
> End Set
> End Property
>
>
> ****My CodeBehind Class----------------
> ' Bind the school by selected state drop-down combobox
> Private Sub SStateDDL_SelectedIndexChanged(ByVal sender As
> System.Object, ByVal e As System.EventArgs) Handles
> SStateDDL.SelectedIndexChanged
> Dim Schools As New DataSet
> Dim Value As String = SStateDDL.SelectedItem.Value
> Schools =
> Accounts.Business.AccountsTool.GetSchoolByState(Va lue)
> SNameDDL.DataSource = Schools
> SNameDDL.DataTextField = "SchoolName"
> SNameDDL.DataValueField = "SchoolID"
> SNameDDL.DataBind()
> End Sub
>
>



Nov 18 '05 #8
it's still not working even when I try..What should I do? Thanks!
then we would see
string X = Accounts.Business.AccountsTool.StateID
or
Accounts.Business.AccountsTool.StateID = "foo"
in your codebehind code

"mortb" <mortb1<noospam<@hotmail.com> wrote in message
news:uU****************@TK2MSFTNGP15.phx.gbl...
then we would see
string X = Accounts.Business.AccountsTool.StateID
or
Accounts.Business.AccountsTool.StateID = "foo"
in your codebehind code

"Leon" <vn*****@msn.com> wrote in message
news:OY**************@TK2MSFTNGP09.phx.gbl...
How do you know the get/set accessor is never called?
"mortb" <mortb1<noospam<@hotmail.com> wrote in message
news:uR**************@TK2MSFTNGP15.phx.gbl...
Problem? It may not be a problem. It depends on what you want to do.
The funciton GetSchoolByState(ByVal StateID As String)
takes a StateID and sets the private variable myStateID. The get/set
accessor is never called in your example but may be somewhere else in
your program.
You should debug and see what is passed into GetSchoolByState.
If the right value is passed the problem lies in the function
GetSchoolByState calls.

cheers,
mortb

"Leon" <vn*****@msn.com> wrote in message
news:ul**************@TK2MSFTNGP14.phx.gbl...
How do I fix that problem?

"mortb" <mortb1<noospam<@hotmail.com> wrote in message
news:eD**************@TK2MSFTNGP15.phx.gbl...
>I don't see the property StateID called anywhere in your sniplet...
>
> /mortb
>
>
> "Leon" <vn*****@msn.com> wrote in message
> news:ee**************@TK2MSFTNGP12.phx.gbl...
>> Why this code is not working? I think the problem is in the business
>> class
>> code.when I select a state from the dropdownlist, the school
>> dropdownlist suppose
>> to fill with school names, but somehow the state value is not getting
>> back
>> to the business class. I think it's the way I'm using property get
>> and set
>> accessor function.
>>
>>
>> ****My Business Class------------
>> ' Private variables
>>
>>
>>
>>
>>
>> '- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>> -
>> - -
>> Private Shared myStateID As String
>>
>> Public Shared Function GetSchoolByState(ByVal StateID As String) As
>> DataSet
>> myStateID = StateID
>> Dim tool As New StuLotto.Accounts.Data.AccountsTool
>> Return tool.GetSchoolByStateList(myStateID)
>> End Function
>>
>> ' Properties
>>
>>
>>
>>
>>
>> '- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>> -
>> - -
>> Public Property StateID() As String
>> Get
>> Return myStateID
>> End Get
>> Set(ByVal value As String)
>> myStateID = value
>> End Set
>> End Property
>>
>>
>> ****My CodeBehind Class----------------
>> ' Bind the school by selected state drop-down combobox
>> Private Sub SStateDDL_SelectedIndexChanged(ByVal sender As
>> System.Object, ByVal e As System.EventArgs) Handles
>> SStateDDL.SelectedIndexChanged
>> Dim Schools As New DataSet
>> Dim Value As String = SStateDDL.SelectedItem.Value
>> Schools =
>> Accounts.Business.AccountsTool.GetSchoolByState(Va lue)
>> SNameDDL.DataSource = Schools
>> SNameDDL.DataTextField = "SchoolName"
>> SNameDDL.DataValueField = "SchoolID"
>> SNameDDL.DataBind()
>> End Sub
>>
>>
>
>



Nov 18 '05 #9
In the debugger!!

"Leon" <vn*****@msn.com> wrote in message
news:um**************@TK2MSFTNGP10.phx.gbl...
nothing is returned. I also change my code to the following and it does not work, but compile errors.

' Bind the school by selected state drop-down combobox

Private Sub SStateDDL_SelectedIndexChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles SStateDDL.SelectedIndexChanged

Dim Schools As New DataSet

Dim Value As String = Accounts.Business.AccountsTool.StateID =
SStateDDL.SelectedItem.Value.ToString

Schools = Accounts.Business.AccountsTool.GetSchoolByState(Va lue)

SNameDDL.DataSource = Schools

SNameDDL.DataTextField = "SchoolName"

SNameDDL.DataValueField = "SchoolID"

SNameDDL.DataBind()

End Sub

"Hans Kesting" <ne***********@spamgourmet.com> wrote in message
news:O6*************@TK2MSFTNGP14.phx.gbl...
Leon wrote:
Why this code is not working? I think the problem is in the business
class code.when I select a state from the dropdownlist, the school
dropdownlist suppose
to fill with school names, but somehow the state value is not getting
back to the business class. I think it's the way I'm using property
get and set accessor function.
****My Business Class------------
' Private variables
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
Private Shared myStateID As String

Public Shared Function GetSchoolByState(ByVal StateID As String) As
DataSet myStateID = StateID
Dim tool As New StuLotto.Accounts.Data.AccountsTool
Return tool.GetSchoolByStateList(myStateID)
End Function

' Properties
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
Public Property StateID() As String
Get
Return myStateID
End Get
Set(ByVal value As String)
myStateID = value
End Set
End Property
****My CodeBehind Class----------------
' Bind the school by selected state drop-down combobox
Private Sub SStateDDL_SelectedIndexChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
SStateDDL.SelectedIndexChanged
Dim Schools As New DataSet
Dim Value As String = SStateDDL.SelectedItem.Value
Schools = Accounts.Business.AccountsTool.GetSchoolByState(Va lue)
SNameDDL.DataSource = Schools SNameDDL.DataTextField =
"SchoolName" SNameDDL.DataValueField = "SchoolID"
SNameDDL.DataBind()
End Sub


When you debug this code, what is returned by the various "GetSchool"
methods? Are you sure the correct "state" value is supplied?

The property you mention is never used (in your published code).
The "StateID" in the first method is a local variable.

Hans Kesting


Nov 18 '05 #10
I got it! Thanks for all the help!!!!
"Leon" <vn*****@msn.com> wrote in message
news:up**************@TK2MSFTNGP15.phx.gbl...
it's still not working even when I try..What should I do? Thanks!
then we would see
string X = Accounts.Business.AccountsTool.StateID
or
Accounts.Business.AccountsTool.StateID = "foo"
in your codebehind code

"mortb" <mortb1<noospam<@hotmail.com> wrote in message
news:uU****************@TK2MSFTNGP15.phx.gbl...
then we would see
string X = Accounts.Business.AccountsTool.StateID
or
Accounts.Business.AccountsTool.StateID = "foo"
in your codebehind code

"Leon" <vn*****@msn.com> wrote in message
news:OY**************@TK2MSFTNGP09.phx.gbl...
How do you know the get/set accessor is never called?
"mortb" <mortb1<noospam<@hotmail.com> wrote in message
news:uR**************@TK2MSFTNGP15.phx.gbl...
Problem? It may not be a problem. It depends on what you want to do.
The funciton GetSchoolByState(ByVal StateID As String)
takes a StateID and sets the private variable myStateID. The get/set
accessor is never called in your example but may be somewhere else in
your program.
You should debug and see what is passed into GetSchoolByState.
If the right value is passed the problem lies in the function
GetSchoolByState calls.

cheers,
mortb

"Leon" <vn*****@msn.com> wrote in message
news:ul**************@TK2MSFTNGP14.phx.gbl...
> How do I fix that problem?
>
> "mortb" <mortb1<noospam<@hotmail.com> wrote in message
> news:eD**************@TK2MSFTNGP15.phx.gbl...
>>I don't see the property StateID called anywhere in your sniplet...
>>
>> /mortb
>>
>>
>> "Leon" <vn*****@msn.com> wrote in message
>> news:ee**************@TK2MSFTNGP12.phx.gbl...
>>> Why this code is not working? I think the problem is in the business
>>> class
>>> code.when I select a state from the dropdownlist, the school
>>> dropdownlist suppose
>>> to fill with school names, but somehow the state value is not
>>> getting back
>>> to the business class. I think it's the way I'm using property get
>>> and set
>>> accessor function.
>>>
>>>
>>> ****My Business Class------------
>>> ' Private variables
>>>
>>>
>>>
>>>
>>>
>>>
>>> '- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>>> -
>>> - -
>>> Private Shared myStateID As String
>>>
>>> Public Shared Function GetSchoolByState(ByVal StateID As String) As
>>> DataSet
>>> myStateID = StateID
>>> Dim tool As New StuLotto.Accounts.Data.AccountsTool
>>> Return tool.GetSchoolByStateList(myStateID)
>>> End Function
>>>
>>> ' Properties
>>>
>>>
>>>
>>>
>>>
>>>
>>> '- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>>> -
>>> - -
>>> Public Property StateID() As String
>>> Get
>>> Return myStateID
>>> End Get
>>> Set(ByVal value As String)
>>> myStateID = value
>>> End Set
>>> End Property
>>>
>>>
>>> ****My CodeBehind Class----------------
>>> ' Bind the school by selected state drop-down combobox
>>> Private Sub SStateDDL_SelectedIndexChanged(ByVal sender As
>>> System.Object, ByVal e As System.EventArgs) Handles
>>> SStateDDL.SelectedIndexChanged
>>> Dim Schools As New DataSet
>>> Dim Value As String = SStateDDL.SelectedItem.Value
>>> Schools =
>>> Accounts.Business.AccountsTool.GetSchoolByState(Va lue)
>>> SNameDDL.DataSource = Schools
>>> SNameDDL.DataTextField = "SchoolName"
>>> SNameDDL.DataValueField = "SchoolID"
>>> SNameDDL.DataBind()
>>> End Sub
>>>
>>>
>>
>>
>
>



Nov 18 '05 #11
I got it! Thanks for all the help!!!!
"Jeff Dillon" <je**@removeemergencyreporting.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
In the debugger!!

"Leon" <vn*****@msn.com> wrote in message
news:um**************@TK2MSFTNGP10.phx.gbl...
nothing is returned. I also change my code to the following and it does

not
work, but compile errors.

' Bind the school by selected state drop-down combobox

Private Sub SStateDDL_SelectedIndexChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles SStateDDL.SelectedIndexChanged

Dim Schools As New DataSet

Dim Value As String = Accounts.Business.AccountsTool.StateID =
SStateDDL.SelectedItem.Value.ToString

Schools = Accounts.Business.AccountsTool.GetSchoolByState(Va lue)

SNameDDL.DataSource = Schools

SNameDDL.DataTextField = "SchoolName"

SNameDDL.DataValueField = "SchoolID"

SNameDDL.DataBind()

End Sub

"Hans Kesting" <ne***********@spamgourmet.com> wrote in message
news:O6*************@TK2MSFTNGP14.phx.gbl...
> Leon wrote:
>> Why this code is not working? I think the problem is in the business
>> class code.when I select a state from the dropdownlist, the school
>> dropdownlist suppose
>> to fill with school names, but somehow the state value is not getting
>> back to the business class. I think it's the way I'm using property
>> get and set accessor function.
>>
>>
>> ****My Business Class------------
>> ' Private variables
>> '- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>> - - - - -
>> Private Shared myStateID As String
>>
>> Public Shared Function GetSchoolByState(ByVal StateID As String) As
>> DataSet myStateID = StateID
>> Dim tool As New StuLotto.Accounts.Data.AccountsTool
>> Return tool.GetSchoolByStateList(myStateID)
>> End Function
>>
>> ' Properties
>> '- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>> - - - - -
>> Public Property StateID() As String
>> Get
>> Return myStateID
>> End Get
>> Set(ByVal value As String)
>> myStateID = value
>> End Set
>> End Property
>>
>>
>> ****My CodeBehind Class----------------
>> ' Bind the school by selected state drop-down combobox
>> Private Sub SStateDDL_SelectedIndexChanged(ByVal sender As
>> System.Object, ByVal e As System.EventArgs) Handles
>> SStateDDL.SelectedIndexChanged
>> Dim Schools As New DataSet
>> Dim Value As String = SStateDDL.SelectedItem.Value
>> Schools =
>> Accounts.Business.AccountsTool.GetSchoolByState(Va lue)
>> SNameDDL.DataSource = Schools SNameDDL.DataTextField =
>> "SchoolName" SNameDDL.DataValueField = "SchoolID"
>> SNameDDL.DataBind()
>> End Sub
>
> When you debug this code, what is returned by the various "GetSchool"
> methods? Are you sure the correct "state" value is supplied?
>
> The property you mention is never used (in your published code).
> The "StateID" in the first method is a local variable.
>
> Hans Kesting
>
>



Nov 18 '05 #12
You still haven't used the debugger, have you. trust me, it's a good thing
to learn

Jeff
"Leon" <vn*****@msn.com> wrote in message
news:eF**************@TK2MSFTNGP15.phx.gbl...
I got it! Thanks for all the help!!!!
"Jeff Dillon" <je**@removeemergencyreporting.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
In the debugger!!

"Leon" <vn*****@msn.com> wrote in message
news:um**************@TK2MSFTNGP10.phx.gbl...
nothing is returned. I also change my code to the following and it does

not
work, but compile errors.

' Bind the school by selected state drop-down combobox

Private Sub SStateDDL_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SStateDDL.SelectedIndexChanged

Dim Schools As New DataSet

Dim Value As String = Accounts.Business.AccountsTool.StateID =
SStateDDL.SelectedItem.Value.ToString

Schools = Accounts.Business.AccountsTool.GetSchoolByState(Va lue)

SNameDDL.DataSource = Schools

SNameDDL.DataTextField = "SchoolName"

SNameDDL.DataValueField = "SchoolID"

SNameDDL.DataBind()

End Sub

"Hans Kesting" <ne***********@spamgourmet.com> wrote in message
news:O6*************@TK2MSFTNGP14.phx.gbl...
> Leon wrote:
>> Why this code is not working? I think the problem is in the business
>> class code.when I select a state from the dropdownlist, the school
>> dropdownlist suppose
>> to fill with school names, but somehow the state value is not getting >> back to the business class. I think it's the way I'm using property
>> get and set accessor function.
>>
>>
>> ****My Business Class------------
>> ' Private variables
>> '- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >> - - - - -
>> Private Shared myStateID As String
>>
>> Public Shared Function GetSchoolByState(ByVal StateID As String) As
>> DataSet myStateID = StateID
>> Dim tool As New StuLotto.Accounts.Data.AccountsTool
>> Return tool.GetSchoolByStateList(myStateID)
>> End Function
>>
>> ' Properties
>> '- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >> - - - - -
>> Public Property StateID() As String
>> Get
>> Return myStateID
>> End Get
>> Set(ByVal value As String)
>> myStateID = value
>> End Set
>> End Property
>>
>>
>> ****My CodeBehind Class----------------
>> ' Bind the school by selected state drop-down combobox
>> Private Sub SStateDDL_SelectedIndexChanged(ByVal sender As
>> System.Object, ByVal e As System.EventArgs) Handles
>> SStateDDL.SelectedIndexChanged
>> Dim Schools As New DataSet
>> Dim Value As String = SStateDDL.SelectedItem.Value
>> Schools =
>> Accounts.Business.AccountsTool.GetSchoolByState(Va lue)
>> SNameDDL.DataSource = Schools SNameDDL.DataTextField =
>> "SchoolName" SNameDDL.DataValueField = "SchoolID"
>> SNameDDL.DataBind()
>> End Sub
>
> When you debug this code, what is returned by the various "GetSchool"
> methods? Are you sure the correct "state" value is supplied?
>
> The property you mention is never used (in your published code).
> The "StateID" in the first method is a local variable.
>
> Hans Kesting
>
>



Nov 18 '05 #13
yes that's how I found my error. Thanks again for all the help!

"Jeff Dillon" <je**@removeemergencyreporting.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
You still haven't used the debugger, have you. trust me, it's a good
thing
to learn

Jeff
"Leon" <vn*****@msn.com> wrote in message
news:eF**************@TK2MSFTNGP15.phx.gbl...
I got it! Thanks for all the help!!!!
"Jeff Dillon" <je**@removeemergencyreporting.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
> In the debugger!!
>
> "Leon" <vn*****@msn.com> wrote in message
> news:um**************@TK2MSFTNGP10.phx.gbl...
>> nothing is returned. I also change my code to the following and it
>> does
> not
>> work, but compile errors.
>>
>> ' Bind the school by selected state drop-down combobox
>>
>> Private Sub SStateDDL_SelectedIndexChanged(ByVal sender As System.Object, >> ByVal e As System.EventArgs) Handles SStateDDL.SelectedIndexChanged
>>
>> Dim Schools As New DataSet
>>
>> Dim Value As String = Accounts.Business.AccountsTool.StateID =
>> SStateDDL.SelectedItem.Value.ToString
>>
>> Schools = Accounts.Business.AccountsTool.GetSchoolByState(Va lue)
>>
>> SNameDDL.DataSource = Schools
>>
>> SNameDDL.DataTextField = "SchoolName"
>>
>> SNameDDL.DataValueField = "SchoolID"
>>
>> SNameDDL.DataBind()
>>
>> End Sub
>>
>> "Hans Kesting" <ne***********@spamgourmet.com> wrote in message
>> news:O6*************@TK2MSFTNGP14.phx.gbl...
>> > Leon wrote:
>> >> Why this code is not working? I think the problem is in the
>> >> business
>> >> class code.when I select a state from the dropdownlist, the school
>> >> dropdownlist suppose
>> >> to fill with school names, but somehow the state value is not getting >> >> back to the business class. I think it's the way I'm using property
>> >> get and set accessor function.
>> >>
>> >>
>> >> ****My Business Class------------
>> >> ' Private variables
>> >> '- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >> >> - - - - -
>> >> Private Shared myStateID As String
>> >>
>> >> Public Shared Function GetSchoolByState(ByVal StateID As String) As
>> >> DataSet myStateID = StateID
>> >> Dim tool As New StuLotto.Accounts.Data.AccountsTool
>> >> Return tool.GetSchoolByStateList(myStateID)
>> >> End Function
>> >>
>> >> ' Properties
>> >> '- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >> >> - - - - -
>> >> Public Property StateID() As String
>> >> Get
>> >> Return myStateID
>> >> End Get
>> >> Set(ByVal value As String)
>> >> myStateID = value
>> >> End Set
>> >> End Property
>> >>
>> >>
>> >> ****My CodeBehind Class----------------
>> >> ' Bind the school by selected state drop-down combobox
>> >> Private Sub SStateDDL_SelectedIndexChanged(ByVal sender As
>> >> System.Object, ByVal e As System.EventArgs) Handles
>> >> SStateDDL.SelectedIndexChanged
>> >> Dim Schools As New DataSet
>> >> Dim Value As String = SStateDDL.SelectedItem.Value
>> >> Schools =
>> >> Accounts.Business.AccountsTool.GetSchoolByState(Va lue)
>> >> SNameDDL.DataSource = Schools SNameDDL.DataTextField =
>> >> "SchoolName" SNameDDL.DataValueField = "SchoolID"
>> >> SNameDDL.DataBind()
>> >> End Sub
>> >
>> > When you debug this code, what is returned by the various
>> > "GetSchool"
>> > methods? Are you sure the correct "state" value is supplied?
>> >
>> > The property you mention is never used (in your published code).
>> > The "StateID" in the first method is a local variable.
>> >
>> > Hans Kesting
>> >
>> >
>>
>>
>
>



Nov 18 '05 #14

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

242
by: James Cameron | last post by:
Hi I'm developing a program and the client is worried about future reuse of the code. Say 5, 10, 15 years down the road. This will be a major factor in selecting the development language. Any...
3
by: S. van Beek | last post by:
Dear reader, I still have a problem with my reference libraries. In my frond end application a check procedure for missing references is available. The problem I confronted with is that...
19
by: Dave | last post by:
I'm building a research application that needs to be a super speed demon. I decided that one way to do this is to use goto loops instead of while() loops when I need them. that way, instead of...
15
by: Bryan | last post by:
I have a multi-threaded C# console application that uses WMI (System.Management namespace) to make RPC calls to several servers (600+ ) and returns ScheduledJobs. The section of my code that...
6
by: TPJ | last post by:
Help me please, because I really don't get it. I think it's some stupid mistake I make, but I just can't find it. I have been thinking about it for three days so far and I still haven't found any...
1
by: garry.oxnard | last post by:
Can anyone help me to solve a problem which involves switching from Access to Excel (then back to Access) programatically please? I have an Excel template which, on open, also opens an Access...
5
by: rdemyan via AccessMonster.com | last post by:
I have a need to add another field to all of my tables (over 150). Not data, but an actual field. Can I code this somehow. So the code presumabley would loop through all the tables, open each...
66
by: Jon Skeet [C# MVP] | last post by:
I'm sure the net will be buzzing with this news fairly soon, but just in case anyone hasn't seen it yet: Microsoft are going to make the source code for the .NET framework (parts of it,...
8
by: Brett | last post by:
I wrote an ASP.NET application that queries a SQL Server database (on a different box from the web server) and displays the result in a GridView. The datasource for the GridView is a SQLDataSource....
11
by: Gord | last post by:
When I open a certain report, it runs some code that generates the records that will be displayed in that report. This works fine. When I go to print preview the report it appears that the code...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.