You are on page 1of 2

using System;

using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Linq;
using System.Xml.Linq;
public partial class CADia : System.Web.UI.Page
{
SqlConnection con = new SqlConnection(@"Data Source=HOME-A5E4896B35\SQLEXPRE
SS;Initial Catalog=Hospital;Integrated Security=True");
SqlCommand cmd;
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button2_Click(object sender, EventArgs e)
{
con.Open();
cmd = new SqlCommand("insert into diareport values('"+TextBox1.Text+"','
"+TextBox5.Text+"',"+TextBox6.Text+"','"+TextBox7.Text+"','"+TextBox8.Text+"','"
+TextBox9.Text+"','"+TextBox10.Text+"','"+TextBox11.Text+"','"+TextBox12.Text+"'
,'"+TextBox13.Text+"','"+TextBox14.Text+"','"+TextBox15.Text+"','"+TextBox16.Tex
t+"','"+TextBox17.Text+"','"+TextBox18.Text+"','"+TextBox19.Text+"','"+TextBox20
.Text+"','"+TextBox21.Text+"','"+TextBox22.Text+"','"+TextBox23.Text+"','"+TextB
ox24.Text+"','"+TextBox25.Text+"','"+TextBox26.Text+"','"+TextBox27.Text+"','"+T
extBox28.Text+"','"+TextBox29.Text+"','"+TextBox30.Text+"','"+TextBox31.Text+"',
'"+TextBox32.Text+"','"+TextBox33.Text+"','"+TextBox34.Text+"','"+TextBox35.Text
+"','"+TextBox36.Text+"','"+TextBox37.Text+"','"+TextBox38.Text+"','"+TextBox39.
Text+"','"+TextBox40.Text+"','"+TextBox41.Text+"','"+TextBox42.Text+"','"+TextBo
x43.Text+"','"+TextBox44.Text+"','"+TextBox45.Text+"','"+TextBox46.Text+"','"+Te
xtBox47.Text+"','"+TextBox48.Text+"','"+TextBox49.Text+"','"+TextBox50.Text+"','
"+TextBox51.Text+"')",con);
cmd.ExecuteNonQuery();
con.Close();
}
protected void Button3_Click(object sender, EventArgs e)
{
TextBox1.Text = "";
TextBox2.Text = "";
TextBox3.Text = "";
TextBox4.Text = "";
TextBox5.Text = "";
TextBox6.Text = "";
TextBox7.Text = "";
TextBox8.Text = "";
TextBox9.Text = "";
TextBox10.Text = "";
TextBox11.Text = "";
TextBox12.Text = "";
TextBox13.Text = "";
TextBox14.Text = "";
TextBox15.Text = "";
TextBox16.Text = "";
TextBox17.Text = "";
TextBox18.Text = "";
TextBox19.Text = "";
TextBox20.Text = "";
TextBox21.Text = "";
TextBox22.Text = "";
TextBox23.Text = "";
TextBox24.Text = "";
TextBox25.Text = "";
TextBox26.Text = "";
TextBox27.Text = "";
TextBox28.Text = "";
TextBox29.Text = "";
TextBox30.Text = "";
TextBox31.Text = "";
TextBox32.Text = "";
TextBox33.Text = "";
TextBox34.Text = "";
TextBox35.Text = "";
TextBox36.Text = "";
TextBox37.Text = "";
TextBox38.Text = "";
TextBox39.Text = "";
TextBox40.Text = "";
TextBox41.Text = "";
TextBox42.Text = "";
TextBox43.Text = "";
TextBox44.Text = "";
TextBox45.Text = "";
TextBox46.Text = "";
TextBox47.Text = "";
TextBox48.Text = "";
TextBox49.Text = "";
TextBox50.Text = "";
TextBox51.Text = "";
}
protected void Button1_Click(object sender, EventArgs e)
{
}
}