Hi friends
I hope you are well
I have a problem is that I had a table named authorization in this structure
create table autorisation
(
Id_autorisation int primary key identity NOT NULL,
Id_user int foreign key references utilisateur (Id_user),
Id_site int foreign key references site (Id_site),
Id_profil int foreign key references profil (Id_profil)
)
In visual studio I have this interface

And in the display I two not display Id_autorization and when I want to click on the modifier it does not work with this request Program.cmd.CommandText = "authorization update in Id_site = (select top 1 Id_site site from the site where Libelle_site = '" + comboBox2.Text + "'), Id_user = (select top 1 utilisateur User_name = '"+ comboBox1. Text +"'), Id_profil = (select top 1 Id_profil from profil where Libelle_profile = '"+ comboBox3.Text +"') where Id_user = (select top 1 utilisateur User_name = @par1)";Program.cmd.Parameters.AddWithValue("@par1", comboBox1.Text);Program.cmd.ExecuteNonQuery ();the same problem in deleteProgram.cmd.CommandText = "delete from autorisation whereId_user = (select top 1 utilisateur User_name = @par1)";Program.cmd.Parameters.AddWithValue("@par1", comboBox1.Text);Program.cmd.Parameters.AddWithValue("@del", comboBox1.Text);Program.cmd.ExecuteNonQuery();In short how to do the deletion and modification without writing in the clause where Id_autorisation = ....And thanks in advance friends
ma oumlPosted May 1, 2017, 4:57 PM
Nilesh ShahPosted May 1, 2017, 4:42 PM
ma oumlPosted May 1, 2017, 3:27 PM
ma oumlPosted May 1, 2017, 3:25 PM
Nilesh ShahPosted May 1, 2017, 3:18 PM
ma oumlPosted May 1, 2017, 1:29 PM
Nilesh ShahPosted May 1, 2017, 10:23 AM