Click here to Skip to main content
16,005,121 members
Home / Discussions / C#
   

C#

 
AnswerRe: Sorting DataGrid => DataTable ?? Pin
Bill Dean10-Jun-04 10:04
Bill Dean10-Jun-04 10:04 
GeneralDataGrids and Business Objects Pin
mchean10-Jun-04 9:16
mchean10-Jun-04 9:16 
GeneralRe: DataGrids and Business Objects Pin
Heath Stewart10-Jun-04 10:17
protectorHeath Stewart10-Jun-04 10:17 
GeneralRe: DataGrids and Business Objects Pin
mchean11-Jun-04 8:24
mchean11-Jun-04 8:24 
GeneralRe: DataGrids and Business Objects Pin
Heath Stewart11-Jun-04 8:55
protectorHeath Stewart11-Jun-04 8:55 
GeneralRe: DataGrids and Business Objects Pin
mchean11-Jun-04 9:06
mchean11-Jun-04 9:06 
GeneralRe: DataGrids and Business Objects Pin
Heath Stewart11-Jun-04 9:09
protectorHeath Stewart11-Jun-04 9:09 
GeneralMonitoring Database Exceptions Pin
aberger5610-Jun-04 8:35
aberger5610-Jun-04 8:35 
First, I am not a C# programmer (although I am trying to learn). I have an intern doing the coding for me on this current project, and he is still trying to put together what they teach in school with the real world.

OK, so here's the problem and question...

A form contains a datagrid (2 columns) and some buttons. We want to prevent a record with either of the fields being null from being written to the database (using MSSql). The table in question is set up with "Allow Nulls" as false. This means that if the user clicks "OK" the message "Column 'Div_Code' does not allow nulls......"

This is fine for me, I know what that means. My users don't. They know the field by the name "Division", and they have no idea what null means.

I would like to do either of the following (and I guess there could be a great deal of discussion about which of the solutions is the most elequent):
1) Either check when leaving the field that it is not null. We tried the columnChanging event, but this doesn't work because the field starts as null, ends as null, and only seems to fire when the value changes; or
2) Intercept the message from the database and substitute our own. I tried using a Try block, but although I traced the execution, I could not see where the message came back.

Anyone have a solution (and if there is a 3rd, 4th or 5th approach, that's good also).

Thanks much...

Alan B
GeneralRe: Monitoring Database Exceptions Pin
Heath Stewart10-Jun-04 10:09
protectorHeath Stewart10-Jun-04 10:09 
GeneralMDI Child Windows Z-Order Pin
Peter Vertes10-Jun-04 8:32
Peter Vertes10-Jun-04 8:32 
GeneralRe: MDI Child Windows Z-Order Pin
Heath Stewart10-Jun-04 10:02
protectorHeath Stewart10-Jun-04 10:02 
GeneralRichTextBox LoadFile question Pin
Flack10-Jun-04 7:58
Flack10-Jun-04 7:58 
GeneralRe: RichTextBox LoadFile question Pin
Dave Kreskowiak10-Jun-04 8:16
mveDave Kreskowiak10-Jun-04 8:16 
GeneralLaunching an External Executable Pin
ZeldaFreak10-Jun-04 5:42
ZeldaFreak10-Jun-04 5:42 
GeneralRe: Launching an External Executable Pin
Dave Kreskowiak10-Jun-04 5:58
mveDave Kreskowiak10-Jun-04 5:58 
GeneralReplace a pattern in a an html file Pin
Sam9643410-Jun-04 5:26
Sam9643410-Jun-04 5:26 
GeneralRe: Replace a pattern in a an html file Pin
Dave Kreskowiak10-Jun-04 7:20
mveDave Kreskowiak10-Jun-04 7:20 
GeneralCF dataset help Pin
lukesmith9910-Jun-04 5:09
lukesmith9910-Jun-04 5:09 
GeneralRe: CF dataset help Pin
Dave Kreskowiak10-Jun-04 5:43
mveDave Kreskowiak10-Jun-04 5:43 
GeneralRe: CF dataset help Pin
lukesmith9910-Jun-04 7:42
lukesmith9910-Jun-04 7:42 
GeneralRe: CF dataset help Pin
Dave Kreskowiak10-Jun-04 8:12
mveDave Kreskowiak10-Jun-04 8:12 
GeneralRe: CF dataset help Pin
lukesmith9910-Jun-04 8:31
lukesmith9910-Jun-04 8:31 
Generalcustom errors on the server Pin
Judah Gabriel Himango10-Jun-04 4:16
sponsorJudah Gabriel Himango10-Jun-04 4:16 
GeneralRe: custom errors on the server Pin
Heath Stewart10-Jun-04 7:08
protectorHeath Stewart10-Jun-04 7:08 
GeneralRe: custom errors on the server Pin
Judah Gabriel Himango10-Jun-04 8:32
sponsorJudah Gabriel Himango10-Jun-04 8:32 

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.