Select ID in [array]

Results 1 to 2 of 2

Thread: Select ID in [array]

  1. #1
    Join Date
    Dec 1969

    Default Select ID in [array]

    I will have an array of varying size which will hold the ID&#039;s from a company table that the particular user can administer. i need to be able to select only those companies who&#039;s ID&#039;s are held in that array, which will vary from user to user.<BR><BR>Could someone please give me an example of how this could be achieved?<BR><BR>Finally, when the user initially logs on i will gather the array of ID values - what is the best method of storing this array for that session, ie use a session var, global array, cache, etc for use throughout that users session. I am using .NET and believe there are better ways to store things like this array, as opposed to using a session var.<BR><BR>Thanks in advance....

  2. #2
    Join Date
    Dec 1969

    Default I can help with..

    .. the first part.<BR><BR>In VB.NET, it would be something like:<BR>[code language="VB.NET"]<BR>Dim sSql As String = ""<BR> sSql = "SELECT * FROM Table WHERE Field IN (" & YourArray.Join(",") & ")"<BR>[/code]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts