Запрос:
using (SqlConnection Connection = new SqlConnection("Data Source=(LocalDB)\\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\\database.mdf;Integrated Security=True;Connect Timeout=30"))
{
Connection.Open();
using (SqlCommand Command = new SqlCommand("insert into RS_USERS (login, password, type) values('piska', 'dsas', '0')", Connection))
{
Command.ExecuteNonQuery();
}
Connection.Close();
}
Структура таблицы:
CREATE TABLE [dbo].[RS_USERS]
(
[user_id] INT NOT NULL PRIMARY KEY IDENTITY(0, 1),
[login] NVARCHAR(50) NOT NULL,
[password] NVARCHAR(50) NOT NULL,
[type] NVARCHAR(50) NOT NULL
)