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
|
|
|
|