-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCompleteBookDetails.cs
More file actions
46 lines (37 loc) · 1.3 KB
/
Copy pathCompleteBookDetails.cs
File metadata and controls
46 lines (37 loc) · 1.3 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
34
35
36
37
38
39
40
41
42
43
44
45
46
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Library_Management_System
{
public partial class CompleteBookDetails : Form
{
public CompleteBookDetails()
{
InitializeComponent();
}
private void CompleteBookDetails_Load(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection();
con.ConnectionString = "Data Source=BT-2105617\\SQLEXPRESS;Initial Catalog=library;Integrated Security=True;";
SqlCommand cmd = new SqlCommand();
cmd.Connection = con;
cmd.CommandText = "select * from IRBook where book_return_date is null";
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
dataGridView1.DataSource = ds.Tables[0];
cmd.CommandText = "select * from IRBook where book_return_date is not null";
SqlDataAdapter da1 = new SqlDataAdapter(cmd);
DataSet ds1 = new DataSet();
da1.Fill(ds1);
dataGridView2.DataSource = ds1.Tables[0];
}
}
}