Guest User

Untitled

a guest
Jun 20th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.75 KB | None | 0 0
  1.  
  2.         private void Form1_Load(object sender, EventArgs e)
  3.         {
  4.             // Create Connection
  5.             string SQLLocation = Path.GetDirectoryName(Application.ExecutablePath) + "\\Data.bin";
  6.             string ConnString = string.Format("Data Source={0};Compress=True;", SQLLocation);
  7.             SQLiteConnection myConnection = new SQLiteConnection(ConnString);
  8.  
  9.  
  10.             DataSet ds = new DataSet();
  11.             string sql = "SELECT name FROM sqlite_master WHERE type='table' ORDER BY name;";
  12.             SQLiteConnection conn = new SQLiteConnection(ConnString);
  13.             SQLiteDataAdapter da = new SQLiteDataAdapter(sql, conn);
  14.  
  15.             da.Fill(ds);
  16.  
  17.             dataGridView1.DataSource = ds.Tables[0].DefaultView;
  18.  
  19.         }
Add Comment
Please, Sign In to add comment