TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Mo Bahgat
NA
55
755
How to save selected items from ListBox on winforms using Entity
Sep 13 2020 3:36 PM
This is what I codding in form public partial class Form1 : Form { TestDBEntities db = new TestDBEntities(); tblData td = new tblData(); } public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { //Binding Data to List Box listbox1.DataSource = db.Countries.ToList(); listbox1.DisplayMember = "CtrName"; listbox.ValueMember = "CtrId"; } private void btnSave_Click(object sender, EventArgs e) { td.Country = listbox1.SelectedItems.ToString(); db.tblData.Add(td); db SaveChange(); }
Reply
Answers (
1
)
Assist with Question
Max query string length