_.NET lab
_.NET lab
using 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;
namespace prog6
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
namespace ex8
{
public partial class WebForm1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
namespace prgm9
{
public partial class WebForm1 : System.Web.UI.Page
{
SqlConnection con = new SqlConnection(@"Data Source = (LocalDB)\\
MSSQLLocalDB; AttachDbFilename=C:\\Users\\Kongu Arts College\\source\\repos\\
prgm9\\prgm9\\App_Data\\Database1.mdf;Integrated Security = True");
protected void Page_Load(object sender, EventArgs e)
{
if(con.State==ConnectionState.Open)
{
con.Close();
}
con.Open();
disp_data();
}
TextBox1.Text = "";
TextBox2.Text = "";
TextBox3.Text = "";
TextBox4.Text = "";
disp_data();
}
TextBox1.Text = "";
TextBox2.Text = "";
TextBox3.Text = "";
TextBox4.Text = "";
disp_data();
}
protected void Button3_Click(object sender, EventArgs e)
{
SqlCommand cmd = con.CreateCommand();
cmd.CommandType = CommandType.Text;
cmd.CommandText = "delete from Employee_Details where Dept_id='" +
TextBox1.Text + "'";
cmd.ExecuteNonQuery();
TextBox1.Text = "";
disp_data();
}
public void disp_data()
{
SqlCommand cmd = con.CreateCommand();
cmd.CommandType = CommandType.Text;
cmd.CommandText = " select * from Employee_Details";
cmd.ExecuteNonQuery();
}
}
Program 10 :
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Data.Sql;
namespace pg10.Properties
{
public partial class WebForm1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{