using System;
using System.Data;
using System.Data.SqlClient;public class gettingdata
{
  public static void Main()
  {
    gettingdata mygettingdata = new gettingdata();
    mygettingdata.Run();
  }  public void Run()
  {
    // Warning: Embedded usernames/passwords in database connection strings are inherently
    // insecure, and should only be used on platforms (e.g. Win9x) that do not support Integrated
    // Security.  See the ASP.NET Quickstart for examples of Integrated Security.
    SqlConnection myConnection = new SqlConnection("server=(local)\\NetSDK;uid=QSUser;pwd=QSPassword;database=northwind");
    SqlDataAdapter mySqlDataAdapter = new SqlDataAdapter("select * from customers", myConnection);    try
    {
      DataSet myDataSet = new DataSet();      mySqlDataAdapter.Fill(myDataSet,"Customers");      foreach (DataRow myDataRow in myDataSet.Tables["Customers"].Rows)
      {
        Console.WriteLine(myDataRow["CustomerId"].ToString());
      }
    }
    catch(Exception e)
    {
      Console.WriteLine(e.ToString());
    }
  }