title: Possible to query As400 DB2 via VB.Net without a PRG?
body: <p>After spending a few days researching and trying to figure this out solo, I could really use some help.</p>
  
  <p>I'm trying to query the As400's database directly from .Net without the use of a As400 program file. I have very little support other than "go ahead and try" from the As400 administrators (I'm being told what I'm attempting hasn't been done here before). </p>
  
  <p>I'd really like to use CWBX. The code below successfully connects, but I could really use a pointer in the right direction on how to build a query:</p>
  
  <pre><code>Dim As400 As New AS400System
  Dim AsProgram As New cwbx.Program
  Dim AsCommand As New cwbx.Command
  Dim strQuery As String
  
  As400.Define("AS400")
  As400.UserID = ""
  As400.Password = ""
  As400.IPAddress = ""
  As400.Connect(cwbcoServiceEnum.cwbcoServiceRemoteCmd)
  
  If As400.IsConnected(cwbcoServiceEnum.cwbcoServiceRemoteCmd) = 1 Then
      MsgBox("Valid Connection")
  Else
      MsgBox("Invalid Connection")
      Exit Sub
  End If
  
  '-----------------------------------------------------------------------------------------
  'Trying to figure out first if this syntax is correct, and if so... where/how to call it??
  '-----------------------------------------------------------------------------------------
  strQuery = "SELECT * FROM Library.File WHERE FILEFIELD='Criteria'"
  ' ---
  
  AsProgram.LibraryName = ""
  AsProgram.ProgramName = "" '?
  AsProgram.system = As400
  
  'Assuming this will end up being a program call?
  'AsProgram.Call()
  
  As400.Disconnect(cwbcoServiceEnum.cwbcoServiceRemoteCmd)
  </code></pre>
  
  <p>I'm very open to any other methods/suggestions. I've looked for guides from IBM's site as well as MSDN and neither actually do direct querying without the use of an As400 program file. Is this even possible?</p>