-
Notifications
You must be signed in to change notification settings - Fork 0
/
Kontakt.aspx.cs
31 lines (24 loc) · 951 Bytes
/
Kontakt.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
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 Default2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Send_besked_Click(object sender, EventArgs e)
{
SqlConnection DBCon = new SqlConnection("Data Source=RDK100938;Initial Catalog=Skole;Integrated Security=True");
//Her indsætter koden de indtastede oplysninger til databasen.
SqlCommand SQLCmd = new SqlCommand("Insert into Kontakt values ('" + kontakt_navn.Text + "','" + kontakt_email.Text + "','" + kontakt_besked.Text + "');", DBCon);
SQLCmd.Connection.Open();
SQLCmd.ExecuteNonQuery();
SQLCmd.Connection.Close();
SQLCmd.Connection.Dispose();
besked_send.Visible = true;
}
}