-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathForm5.cs
39 lines (31 loc) · 1.04 KB
/
Form5.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
using System;
using System.Data.SQLite;
using System.Windows.Forms;
namespace Code_Snippet_Manager
{
public partial class Form5 : Form
{
public Form5(string name)
{
InitializeComponent();
label1.Text = name;
}
private void Form5_Load(object sender, EventArgs e)
{
SQLiteConnection Conn = new SQLiteConnection("Data Source=Snippetdb.sqlite;Version=3;");
SQLiteCommand cmd = new SQLiteCommand("SELECT* FROM snippet WHERE (Name =@Name)");
cmd.CommandType = System.Data.CommandType.Text;
cmd.Connection = Conn;
cmd.Parameters.AddWithValue("@Name",label1.Text);
Conn.Open();
cmd.ExecuteNonQuery();
SQLiteDataReader reader = cmd.ExecuteReader();
richTextBox1.Text = reader["Code"].ToString();
Conn.Close();
}
private void button1_Click(object sender, EventArgs e)
{
fontDialog1.ShowDialog();
}
}
}