Library Management System
Library Management System
Library Management System
Int64 Books;
int BookID;
public View_Book()
{
InitializeComponent();
}
dataGridView1.DataSource = ds.Tables[0];
conn.Close();
// show in datagrid
cmd.CommandText = "Select * from Books";
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
dataGridView1.DataSource = ds.Tables[0];
}
private void dataGridView1_CellContentClick(object sender,
DataGridViewCellEventArgs e)
{
if (dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value != null)
{
BookID =
int.Parse(dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString());
Int64 tableIssue;
int Student_ID;
dataGridView1.DataSource = ds.Tables[0];
da.Fill(ds);
conn.Close();
// show in datagrid
cmd.CommandText = "Select * from tableIssue";
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
dataGridView1.DataSource = ds.Tables[0];
}
}
}
aA