[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Error:  --  'Printing'  is ambiguous, imported from the names spaces or types 'Microsoft.VisualBasic.Powerpacks, System.Drawing'.

Posted on 2011-10-25
3
Medium Priority
?
191 Views
Last Modified: 2012-05-12
I have instances of this error on three different Windows forms. The error:  [ 'Printing'  is ambiguous, imported from the names spaces or types 'Microsoft.VisualBasic.Powerpacks, System.Drawing'.  ]   points to the word printing in this code:

Private Sub BtnPrint_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnPrint.Click
        Me.PrintForm1.PrintAction = Printing.PrintAction.PrintToPreview
        Me.PrintForm1.Print()
    End Sub


I have Visual Basic Power pack 3.0 showing in the "tool box", and PrintForm1 showing at the bottom of the Windows form. If it makes a difference; this program connects to MS SQL Server 2008, and is printing a "Data Grid View"    --     Thank you  
0
Comment
Question by:jampost
  • 2
3 Comments
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 2000 total points
ID: 37024650
This means you have imported two namespaces which both contain a class named Printing. Fully qualify the class name which you are using in code (untested, and for example only):
Private Sub BtnPrint_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnPrint.Click
    Me.PrintForm1.PrintAction = System.Drawing.Printing.PrintAction.PrintToPreview
    Me.PrintForm1.Print()
End Sub

Open in new window

0
 

Author Closing Comment

by:jampost
ID: 37024870
Perfect   --   Thank you  --   That was awesome.
0
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 37024906
NP. Glad to help  = )
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Integration Management Part 2
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question