-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAReport7.cs
More file actions
33 lines (31 loc) · 1.04 KB
/
AReport7.cs
File metadata and controls
33 lines (31 loc) · 1.04 KB
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
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace project
{
public partial class AReport7 : Form
{
public AReport7()
{
InitializeComponent();
}
private void Reject1_Click(object sender, EventArgs e)
{
using (SqlConnection sqlCon = new SqlConnection("Data Source=10N5Q8AKAMRA\\SQLEXPRESS;Initial Catalog=project;Integrated Security=True"))
{
sqlCon.Open();
SqlDataAdapter sqlData = new SqlDataAdapter("select meals.mealID, mealname,count(allergenName) as numberOfAllergens from allergens inner join meals on meals.mealID=Allergens.mealID group by meals.mealID,mealname", sqlCon);
DataTable dtbl = new DataTable();
sqlData.Fill(dtbl);
dataGridView1.DataSource = dtbl;
}
}
}
}