Click here to Skip to main content
15,923,689 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
This case is actually mix session within user. But not happen every time. Only sometime this case is happen.

Sample of mix session happen :

User A submit OT and get transaction No
At the same time User B in progress key in for costcentre B, when click on “Add Into List”, User B see User A record in datagrid and she submit to Manager.
The user B Manager will see OT submitted by User A .

SQL
For x As Integer = 0 To txtempid.Text.Length – 1      ‘this code to check each of employee entry



   If Session("dtOT") Is Nothing Then    ‘initialize session

                        dtOT = DBLayer.Util.Data.MsSql.DBFunction.BuildDataTable("SELECT * FROM  Q_OTDETAILS WHERE REGISNO_T = ''", DBLayer.ClsConnection.getConnString("EPJ_HRMS"))

                    Else

                        dtOT = Session("dtOT")

                    End If------------here assign var to update in session





                            dtOT.Rows.Add(Nrow)   *----------update in session

                        dtOT.AcceptChanges()



                        Session("dtOT") = dtOT

                        Session("ItmNo") = Nothing   *--reset session

                    End If

                End If

            Next

            txtempno.Text = ""

            Session("dtOT") = dtOT

            Me.Datagrid1.DataSource = dtOT

            Me.Datagrid1.DataBind()
Posted

1 solution

Session's won't mix for users! It's not the ay sessions work. If anything is happening as you say then there must be some logical fault in your implementation.

Check on how you are handling data - insert & select.
 
Share this answer
 
Comments
snamyna 10-Jul-12 20:09pm    
What you say is true. But it's happen once in the blue moon

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900