add Listbox Items to a DataSet or DataTable
Hey Guys, i want to add all the items of a Listbox to a DataSet or a DataTable.
My goal is to then add all those items to a Table in my DataBase.
How can i do that? ive lost 2 hours today trying to do that.
Oh and im working in C# there..
thx:)
Post OriginalPosted on ASP.NET but since im desperate i posted here also :bigyello:
Re: add Listbox Items to a DataSet or DataTable
Loop through all the items in the ListBox, create a NewRow for the DataTable and add the item's string value from the ListBox. Does this DataTable already exist? If not, you need to create a new DataTable and Add Columns first. I'd suggest reading up about the DataTable class and its members. Take a look at some of the tutorial links in my signature for ADO.NET information.