using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Library
{
    public partial class FormCategory_Add : Form
    {
        public FormCategory_Add()
        {
            InitializeComponent();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            DataAccess da = new DataAccess();
            da.Connect();
            string sql = "insert into category (catname) values (N'{0}')";
            sql = string.Format(sql,txtname.Text);
            da.DoCommand(sql);
            da.DisConnect();
            this.Close();
        }
    }
}
