-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstudentlost.aspx.cs
41 lines (34 loc) · 1.15 KB
/
studentlost.aspx.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace Orgiz
{
public partial class studentlost : System.Web.UI.Page
{
string strcon = ConfigurationManager.ConnectionStrings["con"].ConnectionString;
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection(strcon);
if (con.State == ConnectionState.Closed)
{
con.Open();
}
SqlCommand cmd = new SqlCommand("insert_lostandfound", con);
cmd.CommandType = System.Data.CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@message", TextBox4.Text.Trim());
cmd.ExecuteNonQuery();
con.Close();
TextBox4.Text = "";
Response.Write("<script>alert('Lost Item Request Sent Successfully');</script>");
}
}
}