Another mechanism, assuming a MyDataGridView is bound to a MyDataTable is as follows:
If String.IsNullOrWhiteSpace(MyDataTable.Rows(r).Item(c).ToString) Then
' Cell is empty or white space
Else
' Cell has something in it
End If
If you regard a white space string as a valid "entry" i.e...
My Windows Forms application uses a DataGridView with over 100 columns. The app was developed in VB with Visual Studio 2012. I have set:
MyDataGridView.AllowUserToOrderColumns = True
There are also horizontal and vertical scroll bars. The ability (provided by Microsoft) for a user to click and...
Hi Zee,
I've been down the same route as you with cmd.ExecuteNonQuery().
I am amazed (in an unpleasantly amazed way) at the number of possible different App Exceptions it can throw.
I must have experienced over 400 different ones, each time I "solved" one problem then another one was...
@Lotok@ Hi James, nice replies and a great blog web site which I found very helpful. Thank you very much for your high standard of code examples and for helping the community.
Best regards,
Rob
Hi Taylor,
Here are few more details to save you some time:
Having a TableLayoutPanel with rows and columns to split your display area into sections is definitely the way to go.
Set it to fill your Windows Form, Click the top right hand corner and configure rows and columns of the grid.
Do...
Enter the following search in Google: "Automate Command Prompt Window (CMD), Redirect Output to Application"
That will answer your question.
I hesitate to publish the link for you because I am unsure of Admins' policy on posting cross references to other sites.
Some forums do not permit this...
I can't take the time to download your complete project either.
How you are visualizing your data? I am guessing here ...
... if you are using a DataGridView in a Windows Forms application, and it is bound to a DataTable then you need to set the following property...
Just as a matter of interest, would this work for you?
I am not suggesting whether this is "good" or "bad" practice, but it seems to answer your question.
My "point" is that passing an Object Array by reference provides a way to return a variable number of parameters of indeterminate type.
I...
Hi Zee,
Out of interest, how do you provide error reporting in the situations where your Functions return "False". Do the functions each call a common error reporting handler? Do you log the messages to a disk file or to a textbox? If you log to a disk file, then at what point does the error...
OK thanks I will implement the advice you have given me. Is this the mechanism?
AppDomain.UnhandledException Event (System)
Sub Main()
Dim currentDomain As AppDomain = AppDomain.CurrentDomain
AddHandler currentDomain.UnhandledException, AddressOf MyHandler
Try
Throw New...
@jmcilhinney@
Thanks. I am keen to learn from you and to take your advice and recommendations. I realize that your thinking is at a more advanced level than my own. Let's assume I delete all my "per Sub/ per Function" exception handling code. What I would then need is a framework which...
@JohnH@
Almost every reference example on Microsoft's web site is like this, containing a simple "catch all" exception handler. Why would Microsoft write example code and supply it as "samples" when it flies in the face of their "advice" elsewhere?
And if the developer budget is limited where...
@jmcilhinney@
Well I agree in part. However when a new application is in its initial stages of development and test, all sorts of unforeseen things can happen. My policy has certainly been to write code to "defend" against every exception that has been generated while the application has been...
In every procedure you write, structure it as follows. This provides general purpose exception handling for every circumstance. TextBox1 is a TextBox object created in Windows Forms Designer.
Private Sub MyProcedure()
Try
'
' Your code here
'
Exit Sub
Catch ex As...
Just a tip on your post. I don't mean to be a smartass, but it's something I was getting wrong until the Admins straightened me out! When posting code snippets you should use the advanced editor, click on the little icon "VB" and when prompted for the "option" type "vb" in lower case. Also just...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.