Showing posts with label record. Show all posts
Showing posts with label record. Show all posts

Thursday, March 22, 2012

Structures vs Variables - Or can I even do this?

Hello all-
I need to pass around the details of a db record a few times and was wondering about using structures. If I create a structure something like the one listed below in one of my XXX.vb files, can I use it like a variable?

**USERDB.VB File**
Public Structure UserDetails
puplic FirstName as string
public LastName as string
End Structure

Public Function GetUserDetails(byval UID as Integer) as UserDetails
**Database crap here**
GetUserDetails.FirstName = objDR("FirstName").tostring
GetUserDetails.LastName = objDR("LastName").tostring
End Function

**WEBFORM1.ASPX.VB**
Private Sub ShowUser(byval UID as integer)
Dim objUserDetails as UserDetails
objUserDetails = GetUserDetails(UID)
lblFirstName.text = objUserDetails.FirstName
lblLastName.text = objUserDetails.LastName
End Sub

Sorry so long. Do I need to destroy the objects when done with them?

Thanks,
DougMaybe use a class instead? Any help would be great!

Tuesday, March 13, 2012

Stuck

Ok,

I got this page (with a datagrid on it) that I hit a button on and it opens
a new page (popup). In that popup I have to option to delete the record that
got me there, or change it.. whatever.

Ok when I am done and close the popup and give focus back to the parent
form...

How can I refresh it so that the changes are shown.. or rebind it or
whatever.. how do I tell the form to do something once the child (popup) is
closed?

thanksYou can use "opener" object before closing the popup form.

like opener.MYFORM.submit(); or opener.refresh;
George.

"HalaszJ" <halaszj@.charter.net> wrote in message
news:eIGGYKAmDHA.2140@.TK2MSFTNGP09.phx.gbl...
> Ok,
> I got this page (with a datagrid on it) that I hit a button on and it
opens
> a new page (popup). In that popup I have to option to delete the record
that
> got me there, or change it.. whatever.
> Ok when I am done and close the popup and give focus back to the parent
> form...
> How can I refresh it so that the changes are shown.. or rebind it or
> whatever.. how do I tell the form to do something once the child (popup)
is
> closed?
> thanks
You can use "opener" object before closing the popup form.

like opener.MYFORM.submit(); or opener.refresh;
George.

"HalaszJ" <halaszj@.charter.net> wrote in message
news:eIGGYKAmDHA.2140@.TK2MSFTNGP09.phx.gbl...
> Ok,
> I got this page (with a datagrid on it) that I hit a button on and it
opens
> a new page (popup). In that popup I have to option to delete the record
that
> got me there, or change it.. whatever.
> Ok when I am done and close the popup and give focus back to the parent
> form...
> How can I refresh it so that the changes are shown.. or rebind it or
> whatever.. how do I tell the form to do something once the child (popup)
is
> closed?
> thanks
You need some Java Script, to reload the grid's page
before closing your popup try :

opener.document.location.href=opener.document.loca tion.href

or

top.opener.navigate(top.opener.document.location.h ref)

Hope this helps

Eduardo

"HalaszJ" <halaszj@.charter.net> wrote in message news:<eIGGYKAmDHA.2140@.TK2MSFTNGP09.phx.gbl>...
> Ok,
> I got this page (with a datagrid on it) that I hit a button on and it opens
> a new page (popup). In that popup I have to option to delete the record that
> got me there, or change it.. whatever.
> Ok when I am done and close the popup and give focus back to the parent
> form...
> How can I refresh it so that the changes are shown.. or rebind it or
> whatever.. how do I tell the form to do something once the child (popup) is
> closed?
> thanks
You need some Java Script, to reload the grid's page
before closing your popup try :

opener.document.location.href=opener.document.loca tion.href

or

top.opener.navigate(top.opener.document.location.h ref)

Hope this helps

Eduardo

"HalaszJ" <halaszj@.charter.net> wrote in message news:<eIGGYKAmDHA.2140@.TK2MSFTNGP09.phx.gbl>...
> Ok,
> I got this page (with a datagrid on it) that I hit a button on and it opens
> a new page (popup). In that popup I have to option to delete the record that
> got me there, or change it.. whatever.
> Ok when I am done and close the popup and give focus back to the parent
> form...
> How can I refresh it so that the changes are shown.. or rebind it or
> whatever.. how do I tell the form to do something once the child (popup) is
> closed?
> thanks