Posted on: 7/27/2015 1:37:12 AM | Views : 824

C#i need to allow user to have multiple selection , so i used a list box. but i can't seems to save all selected data into database.
After much research through google, a lot of them recommended to use for loop or foreach loop but i don't really know how to edit into my code as i need to save the whole thing as a row .
Please do suggest me if there is other way to allow user to have multiple selection. Or do suggest how i can edit my code. thanks in advance , your help is really needed and appreciated.
SqlConnection myConnect = new SqlConnection(strConnectionString); // Start command for inserting of input to table string strCommandText = "INSERT PUser(Username, Password, Role, Country, BU, Dept, Email, AltEmail) " + " VALUES(@NewUsername,@NewPassword,@NewRole,@NewCountry,@NewBU,@NewDept,@NewEmail,@NewAlt)"; // Setting up n ...

Go to the complete details ...