>>>>func SaveHistory() >>>>lparam lcTriggerType >>>>** more code and do the save etc >>>>INSERT INTO historylog (editdate,user,etc) values (datetime(),gcUserName,etc) >>>>>>>>and the triggers look like this:
>>>>*Update Trigger >>>>SaveHistory("U") >>>>*Insert Trigger >>>>SaveHistory("I") >>>>>>>>This works fine from the VFP side. Now lets go to the NET side. We have an SqlDatasource using an OLEDB connection, and a Formview using the SqlDatasource. The user clicks the Formview into edit mode,makes the edits, and then clicks Save/Update which fires the SqlDataSource UpdateCommand. Assuming I can programmatically define the UpdateCommand, how can I embed the value of Session("User") so that the SP can see it?
>>public gcEmployee >>gcEmployee = 'myname' >>>>via the OLEDB connection sometime before the trigger is fired. The value of gcEmployee should then remain available to any subsequent activity as long as the connection remains open. Correct? If this is the case I can understand how the previous code suggestion would work. In my case however I don't have an oConn to work with explicitly. What I have is SQLDataSource1 which handles its connection internally. So I tried this approach
>>Protected Sub FormView1_DataBound(ByVal sender As Object, ByVal e As System.EventArgs) Handles FormView1.DataBound >> SqlDataSource1.UpdateCommand = "Public gcEmployee" + Chr(13) + Chr(10) + "gcEmployee = 'Viv'" + Chr(13) + Chr(10) + SqlDataSource1.UpdateCommand >>End Sub >>>>
UpdateCommand="Public employee" + Chr(13) + Chr(10) + "employee = [Viv]" + "UPDATE rtp_projects SET rtp_id = ?, tip_id = ?, lead = ?, st_name = ?, termini = ?, project = ?, length = ?, detail_des = ?, category = ?, system = ?, subsystem = ?, existlanes = ?, newlanes = ?, est_start = ?, est_finish = ?, newbikelan = ?, multiuse = ?, newwalks = ?, study = ?, design = ?, rw = ?, const = ?, operations = ?, total_cost = ? WHERE keyid = ? ">in the SqlDatasource definition. The syntax checker takes exception to the portion [+ chr(10)].