Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx_beginners thread: populating a table with result from SQL-query


Message #1 by "F-J Mattmann" <f-j.mattmann@e...> on Mon, 29 Apr 2002 14:33:48
Hi
I have
- a SQL-query 
- a datatable 
(I only picked up the intresting rows):

                'create a DataTable
                dt = New DataTable
                dt.Columns.Add(New DataColumn("Totalt", GetType(Integer)))
                
                    For i = 1 To 1
                    dr = dt.NewRow()
                    dr(0) = i
                    dr(1) = i
                    dt.Rows.Add(dr)
                Next


 For i = 1 To 1
                    dr = dt.NewRow()
                    dr(0) = i+1
                    dr(1) = i+2
                    	
-----------------------------------
What I want to do is to populet the row "dr(1)" with the result from a SQL-
query like "select count(*)something"


The Question is how do I write the line: "dr (0) =  "
to get the result of my SQL-query?
Can someone help me?, thanks in advance


  Return to Index