Click here to Skip to main content
15,898,995 members
Home / Discussions / C#
   

C#

 
GeneralMessage Removed Pin
14-Aug-10 0:26
yum 201014-Aug-10 0:26 
GeneralRe: sever is not displaying the content that " you have left the chat room".... Pin
OriginalGriff14-Aug-10 2:01
mveOriginalGriff14-Aug-10 2:01 
GeneralRe: sever is not displaying the content that " you have left the chat room".... Pin
yum 201014-Aug-10 7:45
yum 201014-Aug-10 7:45 
GeneralRe: sever is not displaying the content that " you have left the chat room".... Pin
yum 201014-Aug-10 7:49
yum 201014-Aug-10 7:49 
GeneralRe: sever is not displaying the content that " you have left the chat room".... Pin
OriginalGriff14-Aug-10 8:49
mveOriginalGriff14-Aug-10 8:49 
GeneralRe: sever is not displaying the content that " you have left the chat room".... Pin
Luc Pattyn14-Aug-10 9:05
sitebuilderLuc Pattyn14-Aug-10 9:05 
GeneralRe: sever is not displaying the content that " you have left the chat room".... Pin
OriginalGriff14-Aug-10 9:24
mveOriginalGriff14-Aug-10 9:24 
GeneralRe: sever is not displaying the content that " you have left the chat room".... Pin
Luc Pattyn14-Aug-10 9:27
sitebuilderLuc Pattyn14-Aug-10 9:27 
GeneralRe: sever is not displaying the content that " you have left the chat room".... Pin
OriginalGriff14-Aug-10 9:35
mveOriginalGriff14-Aug-10 9:35 
GeneralRe: sever is not displaying the content that " you have left the chat room".... Pin
yum 201015-Aug-10 8:11
yum 201015-Aug-10 8:11 
QuestionGet cell value from GridView Pin
treuveni13-Aug-10 12:45
treuveni13-Aug-10 12:45 
AnswerRe: Get cell value from GridView Pin
PIEBALDconsult13-Aug-10 17:55
mvePIEBALDconsult13-Aug-10 17:55 
GeneralRe: Get cell value from GridView Pin
treuveni13-Aug-10 21:03
treuveni13-Aug-10 21:03 
AnswerRe: Get cell value from GridView Pin
maddahi.m.p14-Aug-10 0:29
maddahi.m.p14-Aug-10 0:29 
QuestionMessage Removed Pin
13-Aug-10 11:53
Tichaona J13-Aug-10 11:53 
AnswerRe: Playing a list of files on after the other. Pin
AspDotNetDev13-Aug-10 12:22
protectorAspDotNetDev13-Aug-10 12:22 
QuestionHow to properly show text for URL link using RichTextBox to output into RTF format? Pin
jboyd11113-Aug-10 10:53
jboyd11113-Aug-10 10:53 
QuestiondataGridView1_CellContentClick Error Index Out of Range Pin
MumbleB13-Aug-10 10:27
MumbleB13-Aug-10 10:27 
AnswerRe: dataGridView1_CellContentClick Error Index Out of Range Pin
OriginalGriff13-Aug-10 10:39
mveOriginalGriff13-Aug-10 10:39 
GeneralRe: dataGridView1_CellContentClick Error Index Out of Range Pin
MumbleB13-Aug-10 11:02
MumbleB13-Aug-10 11:02 
GeneralRe: dataGridView1_CellContentClick Error Index Out of Range Pin
MumbleB13-Aug-10 11:18
MumbleB13-Aug-10 11:18 
GeneralRe: dataGridView1_CellContentClick Error Index Out of Range Pin
OriginalGriff13-Aug-10 22:59
mveOriginalGriff13-Aug-10 22:59 
GeneralRe: dataGridView1_CellContentClick Error Index Out of Range Pin
MumbleB14-Aug-10 3:41
MumbleB14-Aug-10 3:41 
AnswerRe: dataGridView1_CellContentClick Error Index Out of Range Pin
Luc Pattyn13-Aug-10 14:00
sitebuilderLuc Pattyn13-Aug-10 14:00 
you should clean up your code first.

1.
there is an abundance of unnecessary calls to ToString()
e.g. Exception.Message is a string, calling ToString on it does nothing useful at all.

2.
it does not make sense to convert a number to a string and then back to a number. stop doing that right now.

3.
there is a test for currentRow>=0 somewhere in your code. Why is that? either it is not necessary and you must remove it; or it is necessary, which also means dataGridView1[0, currentRow] can get a bad index. Check the documentation, log the values, do whatever it takes, but make this consistent.


Then you must use all available information:

1.
when an exception occurs, show all of it, not just the message itself. This is the one place you absolutely should use ToString(). Yes it will generate maybe 20 or 30 lines of information, some of that is really useful.

2.
make sure your development tools (Visual Studio or other) ALWAYS show line numbers in editor windows. See #101 and #102 here[^]. As a result an excpetion will be pinpointed to the right line without any doubt.

3.
when an exception occurs, also show additional information. In this case show e.RowIndex, e.ColumnIndex, and whatever you think may be relevant. So next time it throws, you get all of it at a glance.


So start behaving more professionally, clean up, observe, and fix the remaining problems.

Smile | :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.


GeneralRe: dataGridView1_CellContentClick Error Index Out of Range Pin
MumbleB13-Aug-10 21:50
MumbleB13-Aug-10 21:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.