15,897,718 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Vish0512 (Top 8 by date)
Vish0512
25-Apr-13 16:24pm
View
This is the strangest thing to have happened in my life as a coder till date. With utter frustration of trying so many things I left this piece of code for few days and today when I started with fresh mind after watching all the responses above. I just ran the same code (without any code for printing) and it worked fine (printing a blank page). Then I started adding code of printing one by one keeping my fingers crossed and my entire piece is running as expected.
I really can't explain what I've done as I was not even working on this Laptop for last 3 days. I've not installed or uninstalled any s/w... Just hope that it keeps working as is now and dn't trouble me any more. May be some auto update has done the wonder.
Thanks Johnny and Kschuler for taking out time and giving your valuable suggestions.
I'll post over this thread if I happen to find the root cause of issue.
Vish0512
20-Apr-13 6:42am
View
Hi Kschuler,
I'm printing the same thing in another form. Actually I first wrote code for printing in my main form (To print an invoice with sales data details) and this exception came. Then I made a test form with a button to initiate printing and copied entire printing code in that form and it worked. So there is no difference of printer setting or data or any thing. and the most important thing is that when I'm not printing any thing even then this same exception is coming!!!
Do you have any idea of what "External component" can mean going by exception stack trace which I've shared in this post?
Thanks for your help!!
Vish0512
20-Apr-13 6:37am
View
Vow!! It was that simple. and I thought that making any change in datatable will directly run query on DB.. :-P
Thanks a lot Dave. That was really helpful.
Vish0512
19-Apr-13 12:20pm
View
Hi Dave,
I was out of action for some days so delay in the response!!
See I'm totally new to VB.Net and as per my understanding when I fill my Dataset, the data is loaded from DB as per logic (our internal query for the fill method). However, in my case, I don't want to insert data in the DB and before committing, I want change in the set of data.
Let me give you complete picture. The requirement is for a project based on POS(Point of Sale) concept, where a user will select products and a record will be inserted in DGV. now if that user wants to remove any of the selected products, the system should allow him to do so before generating bill. So only one out of all uncommitted records will be removed and rest will remain visible
It is only when the user will click on Create Bill that the system should actually commit the record in DB.
Vish0512
19-Apr-13 12:10pm
View
Hi Johnny,
Thanks for suggestion. However, it is not working still. My local printer is valid and thus is it calling Print() method however, while debugging it is not even going to the first line of PrintPage method of PrintDocument1.
Vish0512
19-Apr-13 12:08pm
View
Hi Kschuler, I'm trying to print data from a DataSet. However, as you can see above, I've given absolutely nothing to print and still getting the same error. And very strangely same code is running from another form in same Project.
Vish0512
19-Apr-13 12:05pm
View
Hi Sargey,
Thanks for correcting me. I'm giving exception Stack trace below. However, in that trace also, inner exception is not coming (i.e. it is null)
System.Runtime.InteropServices.SEHException was unhandled
ErrorCode=-2147467259
Message="External component has thrown an exception."
Source="System.Drawing"
StackTrace:
at System.Drawing.SafeNativeMethods.StartDoc(HandleRef hDC, DOCINFO lpDocInfo) at System.Drawing.Printing.StandardPrintController.OnStartPrint(PrintDocument document, PrintEventArgs e) at System.Windows.Forms.PrintControllerWithStatusDialog.OnStartPrint(PrintDocument document, PrintEventArgs e)
at System.Drawing.Printing.PrintController.Print(PrintDocument document) at System.Drawing.Printing.PrintDocument.Print()
at test.DataEntry.PrintButton_Click(Object sender, EventArgs e) in D:\Projects\test_Reference\test\test\DataEntry.vb:line 958 at System.Windows.Forms.Control.OnClick(EventArgs e) at System.Windows.Forms.Button.OnClick(EventArgs e) at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ButtonBase.WndProc(Message& m) at System.Windows.Forms.Button.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg) at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData) at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.Run(ApplicationContext context) at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun() at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel() at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine) at test.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81 at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args) at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart()
InnerException:
And the code throwing this exception is same as mentioned above. The code is for a POS application where user will enter billing details (material purchased) and finally generate and print bill. I'm using DatagridView to add Product details.
Also, while debugging, it goes to line Me.PrintDocument1.Print(), However, it does not go to the first line (only line) of printpage method and immediately shows exception.
Please let me know if I shall include more information here.
Vish0512
15-Apr-13 19:59pm
View
Hi Dave,
Thanks for your quick response... However, I've one more query here. How to refresh the dataset (I mean which method to use) as I didn't find any "refresh" method linked to dataset.
I tried with below code but it didn't work
DataGridView1.Refresh()
DataGridView1.Parent.Refresh()
Show More