using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;

public partial class _Default : System.Web.UI.Page 
{
    string strSql;
    string strCon;
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void databaseCmd_Click(object sender, EventArgs e)
    {
        strCon = "Data Source=GHOMI-PC;Initial Catalog=master;Integrated Security=True";
        SqlConnection con = new SqlConnection(strCon);
        SqlCommand cmdClasf;
        strSql = "create database product";
        con.Open();
        cmdClasf = new SqlCommand(strSql, con);
        int count = cmdClasf.ExecuteNonQuery();
        con.Close();
        if (count == 0)
            Label1.Text = "Not Created";
        else
            Label1.Text = "Created";

    }
    protected void tableCmd_Click(object sender, EventArgs e)
    {
        strCon = "Data Source=GHOMI-PC;Initial Catalog=product;Integrated Security=True";
        SqlConnection con = new SqlConnection(strCon);
        SqlCommand cmdClasf;
        strSql = "create table books (isbn varchar(13), picUrl varchar(30), title varchar (20), details varchar(20), price int)";
        con.Open();
        cmdClasf = new SqlCommand(strSql, con);
        int count = cmdClasf.ExecuteNonQuery();
        con.Close();
        if (count == 0)
            Label1.Text = "Not Created";
        else
            Label1.Text = "Created";

    }
    protected void insertCmd_Click(object sender, EventArgs e)
    {
        DetailsView1.Visible = true;
    }
}
