Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 22nd, 2010  |  syntax: VB.NET  |  size: 1.22 KB  |  hits: 140  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Imports SqlToolBox
  2. Imports System.Data.SqlClient
  3. Imports System.Configuration
  4.  
  5. Module Module1
  6.  
  7.     Sub Main(ByVal sArgs() As String)
  8.  
  9.         Dim r As RSSFEEDS = New RSSFEEDS()
  10.  
  11.         Dim ds As DataSet = New DataSet()
  12.         r.GetAll(ds)
  13.  
  14.         For Each dt In ds.Tables
  15.             ' Table info
  16.             Console.Write(dt.TableName)
  17.             Console.WriteLine(" has " & dt.Rows.Count & " rows")
  18.             Console.Write("Primary Key: ")
  19.             For Each pk In dt.PrimaryKey
  20.                 Console.Write(pk.ColumnName)
  21.             Next
  22.             Console.WriteLine()
  23.  
  24.             ' Column Info
  25.             For Each dc In dt.Columns
  26.                 Console.Write(dc.ColumnName & " ")
  27.                 Console.Write(dc.DataType.ToString & " ")
  28.                 Console.Write(dc.AllowDBNull & " ")
  29.                 Console.WriteLine(dc.Unique)
  30.             Next
  31.             Console.WriteLine()
  32.  
  33.             ' Data
  34.             For Each dr In dt.Rows
  35.                 For Each dc In dt.Columns
  36.                     Console.Write(dc.ColumnName & ":")
  37.                     Console.WriteLine(dr.Item(dc))
  38.                 Next
  39.             Next
  40.  
  41.         Next
  42.  
  43.         Console.ReadLine()
  44.     End Sub
  45. End Module