-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathalta.aspx.cs
More file actions
31 lines (28 loc) · 974 Bytes
/
alta.aspx.cs
File metadata and controls
31 lines (28 loc) · 974 Bytes
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.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace WebApplication1
{
public partial class alta : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void add_Click(object sender, EventArgs e)
{
string s = System.Configuration.ConfigurationManager.ConnectionStrings["cadenaconexion1"].ConnectionString;
SqlConnection conexion = new SqlConnection(s);
conexion.Open();
SqlCommand comando = new SqlCommand("insert into alumnos(dni,apellidonom,provincia) values('" +
dni.Text + "','" + this.name.Text + "','" +
state.Text + "')", conexion);
comando.ExecuteNonQuery();
Label1.Text = "Se registro el alumno";
conexion.Close();
}
}
}