Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
tools
vsnet.act
vsnet.debugging
vsnet.documentation
vsnet.enterprise.tools
vsnet.general
vsnet.ide
vsnet.jlca
vsnet.servicepacks
vsnet.setup
vsnet.vsip
vsnet.vss
vsnet.vstools.office
vstudio.development
vstudio.extensibility
vstudio.general
vstudio.helpauthoring
vstudio.setup
vstudio.sourcesafe
  
 
date: Thu, 11 Sep 2008 09:15:04 +0200,    group: microsoft.public.vstudio.development        back       


Query based on Query   
Hi,

I am using visual studio 2008 express (visual basic). I am doing  a query 
against a SQL Server which wirks fine. Now I would like to create a second 
query based on the results from the first query.
I know this from Access - you create a query lets say A_Result and then you 
create a second query based on the first one. The first one is then treated 
as a normal table.
Here is my start code:

-----

  Dim SQLCon As New SqlConnection
    Dim SQLConnectString As String
    Dim SQLState1 As String
    Dim SQLQuery As New SqlDataAdapter
    Dim Dataset1 As New DataSet

        SQLConnectString = "data source=DB;Initial Catalog=DB1;User 
ID=User1;Password=PWD;"
        SQLState1 = "SELECT ..............;"


        SQLCon = New SqlConnection(SQLConnectString)
        SQLCon.Open()

        SQLQuery = New SqlDataAdapter(SQLState1, SQLConnectString)

        SQLQuery.Fill(Dataset1)
        SQLCon.Close()

        'just to see results
        For Each table In dataset1.Tables
            MsgBox(table.tablename)
            For Each Column In table.columns
                MsgBox(Column.columnname)
            Next
        Next
----

Against the dataset1 I want now to run a second query with a select 
statement. Is that possible?

Greetz
date: Thu, 11 Sep 2008 09:15:04 +0200   author:   MatthiasW

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us