CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> .NET

 Method to Lookup Value in table before insert

Print topic Send  topic

Author Message
Diesel

Posts: 43
Posted: 04/19/2006, 1:42 PM

Hi there

I am using the "Before Submit Event"

I've got a problem. I've tried everything by using all the examples I could find with no luck.

I currently have a editable grid with a textbox called "receiver_id". I use a popup to select a name. Before I insert the record I want to lookup the "id" of the username e.g

receiver_id= "Adam Best"

--------> do lookup and get value back e.g "25"

Use "25" in my insert event.

The current lookup I've got that works is by using this:

System.Web.HttpContext.Current.Session("PersonID")=CType((New IntegerField("",Settings.GRDBConnDataAccessObject.ExecuteScalar("SELECT " & "Person_ID" & " FROM " & "GRDB_T_Person" & " WHERE " & "Person_Fullname='Adam Best'"))).Value, Int64)

This returns the value "25" and then my insert works.

What is the correct syntax for using the textbox so I could have something like this?

System.Web.HttpContext.Current.Session("PersonID")=CType((New IntegerField("",Settings.GRDBConnDataAccessObject.ExecuteScalar("SELECT " & "Person_ID" & " FROM " & "GRDB_T_Person" & " WHERE " & "Person_Fullname='" + {receiver_id} + "'"))).Value, Int64)

===============================================

Or is there a better solution by using some other event like "Before Execute Insert"?

All help is highly appreciated and I will be forever grateful

Thx
Zack
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.