document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. namespace InventoryToko
  2. {
  3.     public partial class ManageUsers : Form
  4.     {
  5.         public ManageUsers()
  6.         {
  7.             InitializeComponent();
  8.         }
  9.         SqlConnection Con = new SqlConnection(@"Data Source=(LocalDB)\\v11.0;AttachDbFilename=C:\\Users\\dwi\\Documents\\Inventorydb.mdf;Integrated Security=True;Connect Timeout=30");
  10.         private void CloseTb_Click(object sender, EventArgs e)
  11.         {
  12.             Application.Exit();
  13.         }
  14.  
  15.         void populate()
  16.         {
  17.             try
  18.             {
  19.                 Con.Open();
  20.                 string Myquery = "select * from UserTbl";
  21.                 SqlDataAdapter da = new SqlDataAdapter(Myquery, Con);
  22.                 SqlCommandBuilder builder = new SqlCommandBuilder(da);
  23.                 var ds = new DataSet();
  24.                 da.Fill(ds);
  25.                 UsersGv.DataSource = ds.Tables[0];
  26.                 Con.Close();
  27.             }
  28.             catch
  29.             {
  30.             }
  31.         }
  32.  
');