Welcome to Dream.In.Code
Become a VB.NET Expert!

Join 150,077 VB.NET Programmers for FREE! Get instant access to thousands of VB.NET experts, tutorials, code snippets, and more! There are 1,751 people online right now. Registration is fast and FREE... Join Now!




drag and drop div from data source

 
Reply to this topicStart new topic

drag and drop div from data source

DragNDroppa
23 Apr, 2008 - 07:06 PM
Post #1

New D.I.C Head
*

Joined: 23 Apr, 2008
Posts: 1

I need some advice with getting data from the data reader and inserting it into a div as a drag and droppable div.
I have a div setup to hold all of the dnd objects, but each object needs to be its own div to use with my javascript code.
CODE

Try
    conn.Open()
    reader = cmdSelect.ExecuteReader()
    While reader.Read()
      unavailable.Add(reader.item("UnAvailable").ToString())
    End While
  
    reader.close()

    myreader = sql.ExecuteReader()
    while myreader.Read()
      available.Add(myreader.item("Available").ToString())
    end while
        
    myreader.Close()
    
    conn.Close()
    
  Catch
  End Try

In other words I need a dynamic number of divs, each containing a value(happens to be a name), from my database. I intend to drag these names from one area of the page and drop them in another area of the page.
Any advice?
User is offlineProfile CardPM
+Quote Post

Jayman
RE: Drag And Drop Div From Data Source
23 Apr, 2008 - 08:31 PM
Post #2

Student of Life
Group Icon

Joined: 26 Dec, 2005
Posts: 7,319



Thanked: 66 times
Dream Kudos: 500
Expert In: Everything

My Contributions
Since you are referrring to Html elements, I am going to assume you are using ASP.NET with VB code-behind. Is that correct?

You could use the StringBuilder object to create the div in code. Once you have the data inserted into the div into the proper locations then move on the next div you need to create. Once you have completed building all the divs', either stored in some type of List (array, arraylist, etc) or built as one big string, then send the data to your page.

Is this what you were looking for? If not, then can you be a little more specific about which part you are having trouble.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/8/09 11:17PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live VB.NET Help!

VB.NET Tutorials

Reference Sheets

VB.NET Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month