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; using System.Data.SqlClient; namespace Cafe11 { public partial class Registration : Form { public Registration() { InitializeComponent(); } private void Registration_Load(object sender, EventArgs e) { } private void button1_Click(object sender, EventArgs e) { string username = textBox5.Text; string password = textBox6.Text; string id = textBox4.Text; SqlConnection conn = new SqlConnection("Data Source=class31000;Initial Catalog=LebedenkoPratika;Integrated Security=True"); conn.Open(); // Поиск пользователя в базе данных SqlCommand cmd = new SqlCommand("INSERT INTO DataLogin (Login,Password,ID_Роли) Values (@Log,@Pass,@id)", conn); cmd.Parameters.AddWithValue("@Log", username); cmd.Parameters.AddWithValue("@Pass", password); cmd.Parameters.AddWithValue("@id", id); cmd.ExecuteNonQuery(); } } }