Question

printer management

Asked by: gecko_au2003

I asked this question on EE not long ago here

http://www.experts-exchange.com/Programming/Languages/.NET/Visual_Basic.NET/Q_24649134.html

However I am struggling to see how to use the data tables adequately and efficiently so as to link wmi querries together ie

1. application loads and enumerates printers which is set on form 2 as to whether its the local machine or a print server ( remote machine )

2. User selects / clicks on the printer for which they want to manage and it will enumerate all print jobs for the selected printer into a 2nd list view

Both list views will have multiple columns so as to show information about the printers in the printers listview and about print jobs in the print jobs list view

The last question got as far as making the data tables but I do not understand how at the end you would get all the information out of the data tables into the listview and also how to link the 2nd list view into the first one so that when a printer is selected it will populate the 2nd list view with relevant info.  

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2009-08-26 at 23:35:41ID24685625
Topic

Microsoft Visual Basic.Net

Participating Experts
2
Points
500
Comments
21

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. Enumerate remote printers and the current spooled jobs usi…
    USING WMI A) Enumerate the printers from a remote machine to a list. B) Clicking on a printer on the list would: 1. Show me the Printer path, Description, Comment, etc. 2. Populate all the printjobs for that printer to a listview. C) Being able to Stop, purge, etc. (mana...
  2. Vbscript & WMI Printer classes
    Hi, Is it possible to install and printer drivers for a new printer device using vbscript and WMI? I have started with a basic Query that can get the PrinterName and some other basic information. What im looking for is the possibilty to install an printer driver for each foun...
  3. WMI with printers routers and switches.
    I've written a network discovery tool that will discover all of the available machiens on the network. The next step is for me to run through the list of available devices and query for as much information as possible. Now, I can query the windows machines no problem, but I'd...
  4. Signal Strength, Visual Basic.net, Ndis80211Receiv…
    Hi. I'm testing the solution "Visual Basic, WMI and WiFi Signal Strength" asked by Jenn3 and solved by Mikal613. I have an Intel(R) Pro/Wireless LAN PC Card and Windows 2000. The card is working correctly. Running the solutions, and using a break point to intercep...
  5. wmi
    I want to be able to connect to another pc and view its data, and be able to restart the pc, etc. However I cannot do it. I was told before that u have to have an account with the same name on the client pc that u are trying to connect. Meaning if my account name is admin th...
  6. WMI, Printer c# 2005 express ?
    ok Found this article on codeproject.com and this is the first time I have used c# and I dont see any download to the source code to a working example and am having a hard time trying to use wmi within any language in 2005 so if someone could help me get this example on code ...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: AfricansPosted on 2009-08-27 at 06:29:53ID: 25197857

Check this topic, it may help you
http://www.devasp.net/net/articles/display/697.html

Good Luck

 

by: CodeCruiserPosted on 2009-08-27 at 06:47:00ID: 25198061

Its not clear from the question whether you need help with retrieving the print jobs or filtering the results for the second listview. If its the later then you could filter results like this

dTable.DefaultView.RowFilter = "PrinterName='" & printer & "'" //the printer name from the first listview
For i as integer = 0 to dTable.DefaultView.Count - 1
    ListView2.Items.Add(dTable.DefaultView.Item(i).Item(0))
Next

                                              
1:
2:
3:
4:

Select allOpen in new window

 

by: gecko_au2003Posted on 2009-08-27 at 07:26:22ID: 25198546

Both - Im a bit confused with it as I have never used data tables before

 

by: AfricansPosted on 2009-08-27 at 07:43:35ID: 25198757

Check this topic about creating data table, it may help you:
http://www.startvbdotnet.com/ado/datatable.aspx

By the way your question is not clear and that is why there is no reply.

Good Luck

 

by: gecko_au2003Posted on 2009-08-27 at 07:47:20ID: 25198824

I've never made a fully fledged application before , I have mucked about with WMI but have no clue or idea the best method / approach for it hence why my question is confusing / not clear.

If we could start from the begining and get the printers enumerated into the first list view with all the relevant columns as per the first question ie

Printer Name     |      Port                |       Printer Status       |     Job  Size        |     Page X of  Y etc

 

by: gecko_au2003Posted on 2009-08-27 at 08:00:17ID: 25198987

In simple terms

Application has the following

Forms * 2
Listviews * 2

Other controls as required ie buttons etc ( controls can be if need be swapped ie listview for grid control maybe ? )

1. Launch application and it prompts you with form 2 which prompts for relevant information ie

server name :
Login Username
Login Password

If servername is a local one ie a dot ( . ) , 127.0.0.1 or localhost then it greys out username and password fields and when you click the ok button it uses the relevant wmi code to either connect to the local machine or a remote machine ( remote machine being a print server )

2. First form loads connecting to the relevant machine with or without logon credentials ( relevant to the connection type ) and the first list view enumerates the relevant printers on the machine specified on form 2 as per step 1 into the first list view ( for the printers ) and each column is populated at the same time ie printer name, port, printer status, job size, etc etc ( similiar to the windows printer dialog window )

OPTIONAL

3. Link List View 2 ( the print jobs list view ) to the relevantly selected printer ( which code cruiser already gave me a snippet of code for so if the above works using data tables or whatever method required then I should be able to hopefully copy and paste the code and move it around and the likes


*NOTE*

I have no idea how to link the wmi querries etc because different win32 wmi classes have different properties and when looking at it , it seems that you have to some how link a few printer classes together unless I am missing the point.

 

by: gecko_au2003Posted on 2009-08-31 at 22:38:30ID: 25228768

Any replies at all ????

Anyone there ?

 

by: gecko_au2003Posted on 2009-09-07 at 23:45:17ID: 25279139

The first question if you click on the link provided in the question shows that the print jobs have been retrieved but have been stored in the data table , I do not know how to access the relevant information to populate the first listview using that and if need be can ask another question to ascertain how to populate the second list view based on the selection made on the first one.

Any help at all ?

If no one answers can I either have a refund of points and close question or at least email someone like idle_mind or someone who can help.

code cruiser from the first question was very helpful.

 

by: CodeCruiserPosted on 2009-09-08 at 01:21:13ID: 25279664

You can populate the ListView from a datatable using the code below


        For i As Integer = 0 To dTable.Rows.Count - 1
            Dim item As New ListViewItem
            item.Text = dTable.Rows(i).Item(0)
            item.SubItems.Add(dTable.Rows(i).Item(1))
            item.SubItems.Add(dTable.Rows(i).Item(2))
            ListView1.Items.Add(item)
        Next
                                              
1:
2:
3:
4:
5:
6:
7:

Select allOpen in new window

 

by: gecko_au2003Posted on 2009-09-08 at 05:32:29ID: 25281142

Any chance you can take the code from the first question and combine it with above code so it outputs the relevant items into the relevant columns for the printers listview and will accept that as a solution for this question and will re ask another question for the 2nd listview part.

Thanks again code cruiser!!

 

by: CodeCruiserPosted on 2009-09-08 at 05:37:31ID: 25281179

The trouble is i work on a full time job and i am at job now so i have to do the work for which i get paid. I am afraid i would not be able to do all that for you. You would have to take that initiative yourself and if you face any problems, i will be here to help.

 

by: gecko_au2003Posted on 2009-09-30 at 06:02:14ID: 25458329

First off I did not expect the whole coded solution as I did say afterwards about just the first part for the first listbox and have replied a number of times

2nd of all why no refund as I have not heard anything back

 

by: gecko_au2003Posted on 2009-10-05 at 23:51:32ID: 25502340

http:#25281179

comment id 25281179

was just stating that he had a full time job and I would have to resolve the issue myself which does not really help and I have been replying hence my above posts so how is that not responding ?

As for deletion no refund I did not get much from this question so feel that it was a waste of points if I am not getting the points back - if you need to assign the points then assign them to code cruiser as he helped as much as possible taking into consideration he is obviously busy with work etc

I do not understand vb dot net enough yet to establish what I need to use to accomplish what I am trying to do if code cruiser or someone could give me a list of things I would need to look into then I could research ie google those things so far data tables is the only thing I am aware of but not sure that would be all the things / items I would need to look into.

 

by: CodeCruiserPosted on 2009-10-06 at 01:30:09ID: 25502817

You need to buy a good VB. NET beginners book or search for VB.NET beginners articles on google.

 

by: gecko_au2003Posted on 2009-10-09 at 15:44:17ID: 25539477

ive got a 2003 vb.net book but that mostly goes through arrays, loops, controls but nothing to do with data tables etc so I have done the very basic stuff but need suggestions with regards to which books would help me more so with the more advanced topics ie data tables, using wmi effectively etc etc etc

any suggestions ?

 

by: CodeCruiserPosted on 2009-10-10 at 11:48:36ID: 25543313

It was some time ago that i stopped buying books because i discovered google!

 

by: gecko_au2003Posted on 2009-11-15 at 06:45:36ID: 31621076

I understand time is an issue but the answers given are only very small pieces of the answer in relation to the question asked.

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...