Sachin Singh4y agoPosted Jan 5, 2022, 4:33 AMThats great.There are multiple ways to bind dropdownlist in MVC. so, i recommend you to please go through my article on thishttps://sharpencode.com/HowToTopic/binding-dropdownlist-in-asp-net-mvc
Abdel Fardjallah4y agoPosted Jan 5, 2022, 1:56 AMThank you for the answer.No problem with data. Drop down list displays data from db.The create button is suposed to insert drop down lists values as a row in vote table, but instead it raises an exception: object reference not set to an instance of an object.Can't understand why
Sachin Singh4y agoPosted Jan 3, 2022, 5:16 AMMake two changesfirst, inside Vote constructor, initialize the Activitiespublic vote() { ListeActivities= new List<Activities>(); // other list type } second make sure you are getting data from dbmodify line 46SqlConnection connect=new (connectionstring); to SqlConnection connect=new SqlConnection(connectionstring);
Sachin SinghPosted Jan 5, 2022, 4:33 AM
Abdel FardjallahPosted Jan 5, 2022, 1:56 AM
Sachin SinghPosted Jan 3, 2022, 5:16 AM