Update an existing parking lot visio document in VB.Net.

Started by Jon Gottlob, April 01, 2014, 08:47:30 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Jon Gottlob

Greetings,

I have existing visio documents that contains the layout of various parking lots and their numbered parking spaces.  My task is to add the person assigned to the parking space based on data in a SQL Server database.

This would be done in VS2010, using VB.Net.

I haven't done anything along these lines before, but I'm experienced in VB.Net, just not integrating the Visio side of it.

Any suggestions on where to start?



aledlund

without seeing an example of the documents, it would be very hard.
al

Jon Gottlob

For each of the labeled parking space - there is an employee name associated with it in a SQL server table, based on the spot name - for example - "A-01" is associated to "Bud Henderson".

---------------
A-10 Bud Henderson
---------------
A-11 Steve Smith
----------------
A-12 Byron Nelson
----------------

In the visio document, the names do not appear and that is the what I'm trying to accomplish, adding the names from the DB into the Visio document in the correct spot.

Jon Gottlob

Attached is an image of one of the visio parking lots.


Jumpy

If you've Visio Professional available that could be done without any coding using the Datalink feature, to link shapedata to a database or an excel sheet.

aledlund

Jon,
i'm aware of what a parking lot may look like, the request was for the visio file. Jumpy is correct in that the easiest method is to datalink using one of the Visio Pro versions (starting with 2007).
al

Jon Gottlob

al - I took "without seeing" as something else.  I've attached the diagram, but it looks like I may not need to worry about the code anyway.

Thanks for the suggestions.  I will do some reading up on datalink and see if it meets my needs.  If not, I'll be back.


aledlund

Jon,
The parking spot 'name' is merely a text box, so linking the shape to a datarecordset is very simple. Just ensure that the record has the spot name in it so that you can create the link. (it's a link to text operation)
al

Jon Gottlob

Thanks!

A question.  How does it keep the visio diagram in synch with the data in the table?  Would it refresh it when the document is opened?


JohnGoldsmith

John Goldsmith - Visio MVP
http://visualsignals.typepad.co.uk/

Jon Gottlob

Thanks for all the help.  I will have to watch the YouTube video at home, since we cannot access that at work.


Jon Gottlob

Well, the initial auto-linking is working, but refreshing the data after I've changed values in the database is not.

Any thoughts?

aledlund

doing problem determination is a two step process, a.) verify that the recordset has been updated correctly b.) matching the record/recordset against the shapesheet data.
al