|
Kutubxonani avtomatlashtirish tarixi 9
|
bet | 7/12 | Sana | 14.05.2024 | Hajmi | 2,44 Mb. | | #232837 |
Bog'liq Abdulloyeva Sitorausing 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 WindowsFormsApp4
{
public partial class book : Form
{
public book()
{
InitializeComponent();
}
SqlConnection con = new SqlConnection(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\user\Documents\Kutubxonadb.mdf;Integrated Security=True;Connect Timeout=30");
private void label7_Click(object sender, EventArgs e)
{
populate();
}
public void populate()
{
con.Open();
string query = "select* from Bookdb";
SqlDataAdapter da = new SqlDataAdapter(query, con);
SqlCommandBuilder builder = new SqlCommandBuilder(da);
var ds = new DataSet();
da.Fill(ds);
BGridView1.DataSource = ds.Tables[0];
con.Close();
}
private void label3_Click(object sender, EventArgs e)
{
}
private void label4_Click(object sender, EventArgs e)
{
}
private void label5_Click(object sender, EventArgs e)
{
}
private void label6_Click(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
if (BookName.Text == "" BAuthor.Text == "" BPublisher.Text == "" BPrice.Text == "" BQuality.Text == "")
{
MessageBox.Show("Ma'lumot qo'shildi");
|
| |