using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Data.SqlClient;
using System.Text;
using System.Windows.Forms;

namespace AjanseProject
{
    public partial class karbaran : Form
    {
        SqlConnection con = new SqlConnection();
        SqlCommand cmd = new SqlCommand();
        SqlDataAdapter da = new SqlDataAdapter();
        DataSet ds = new DataSet();
        public karbaran()
        {
            InitializeComponent();
        }

        private void karbaran_Load(object sender, EventArgs e)
        {
            con.ConnectionString = "Data Source=" + Environment.MachineName + ";Initial Catalog=ajans;Integrated Security=True";
            con.Open();
            cmd.Connection = con;
            //*********************************
            ds.Clear();
            cmd.CommandText = "select * from users";
            cmd.ExecuteNonQuery();
            da.SelectCommand = cmd;
            da.Fill(ds, "users");
            dataGridView1.DataSource = ds;
            dataGridView1.DataMember = "users";
        }

        private void toolStripButton1_Click(object sender, EventArgs e)
        {

        }
    }
}
