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
anurag guhe
NA
43
6.7k
inserting 10-12 items from listbox into sql database
Jul 13 2016 7:10 AM
hi guys...I am developing windws form & in that form 1 is combox , 1 listbox & 1 button .... listbox containg items after selecting items from combobox now i want when i clicking on save button how should i am inserting the all items from listbox into sql database...here following is my code
private void Btn_Save_Click(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection(ConnectionString);
con.Open();
str = "insert into Customer_Entery_Form values('"+Lst_Bx_Service_Name.Items.ToString()+ "')";
com = new SqlCommand(str, con);
com.ExecuteNonQuery();
con.Close();
MessageBox.Show("Records successfully Inserted");
Lst_Bx_Staff_Name.Items.Clear();
}
now the problem is that data is inserting successfully from listbox but when i am showing in sql database it shows like "
System.Windows.Forms.ListBox+ObjectCollection
"
Reply
Answers (
3
)
how to Parse the following XML and generate HTML code in pr
How to make send sms to mobile use pc