Click here to Skip to main content
15,914,225 members
Home / Discussions / Database
   

Database

 
AnswerRe: update data from datagrid using ado in vb.net Pin
Walter_H8-Jan-07 2:41
Walter_H8-Jan-07 2:41 
QuestionCopying text field Pin
Imtiaz Murtaza25-Dec-06 23:35
Imtiaz Murtaza25-Dec-06 23:35 
AnswerRe: Copying text field Pin
Mairaaj Khan27-Dec-06 1:02
professionalMairaaj Khan27-Dec-06 1:02 
QuestionExport and import commands using C# Pin
KishoreT25-Dec-06 21:16
KishoreT25-Dec-06 21:16 
QuestionMerging of two datasets Pin
KishoreT25-Dec-06 21:15
KishoreT25-Dec-06 21:15 
Questionmdb file in vs2005 support UTF8 Pin
hamidaman25-Dec-06 11:41
hamidaman25-Dec-06 11:41 
QuestionAssiging a Dataset to GridView Pin
rahul_spi25-Dec-06 8:18
rahul_spi25-Dec-06 8:18 
AnswerRe: Assiging a Dataset to GridView Pin
PavanPareta25-Dec-06 17:22
PavanPareta25-Dec-06 17:22 
QuestionHow to connect the POstgreSQL 8.1.4 with Borland Developer Studio 2006 (Delphi.NET) Pin
Dotnetfish25-Dec-06 5:29
Dotnetfish25-Dec-06 5:29 
AnswerRe: How to connect the POstgreSQL 8.1.4 with Borland Developer Studio 2006 (Delphi.NET) Pin
Keith Malwitz25-Dec-06 17:40
Keith Malwitz25-Dec-06 17:40 
Questionhow to select multiple data from a single DataSet. Pin
PavanPareta25-Dec-06 1:34
PavanPareta25-Dec-06 1:34 
QuestionNOT NULL + DefaultValue column in DataGridView Pin
El'Cachubrey24-Dec-06 23:37
El'Cachubrey24-Dec-06 23:37 
AnswerRe: NOT NULL + DefaultValue column in DataGridView Pin
Uri Lavi26-Dec-06 8:48
Uri Lavi26-Dec-06 8:48 
GeneralRe: NOT NULL + DefaultValue column in DataGridView Pin
El'Cachubrey26-Dec-06 21:19
El'Cachubrey26-Dec-06 21:19 
GeneralRe: NOT NULL + DefaultValue column in DataGridView Pin
Uri Lavi27-Dec-06 0:59
Uri Lavi27-Dec-06 0:59 
Hi,
1. The cleanest way to do it in my opinion is to use SPs. The SP will test using sql whether the DateTime is NULL and if so won't insert it.
<br />
...<br />
SqlCommand insertCommand = new SqlCommand(...);<br />
insertCommand.CommandType = CommandType.StoredProcedure;<br />
insertCommand.CommandText = "YourSPNameHere";<br />
...<br />

2. It seems wrong but it's ok.
if you read about nullVale in urn:schemas-microsoft-com:xml-msprop (with replacement value) you will find that it just provides a mean to access DBNull cell without throwing an exception, but it doesn't assigns that default value to the DS's cell.
Therefore this code just assigns that default value to the desired cell.

3. Yes, you are right.
You can change the code I have provided to be:
<br />
private void t_tRowChanged<br />
(object sender, TDS.tRowChangeEvent e)<br />
{<br />
 if(e.Action == DataRowAction.Add)<br />
 {<br />
  e.Row.d = System.DateTime.Now;<br />
 }<br />
}<br />

or to use SP as I have stated early.

Uri

GeneralRe: NOT NULL + DefaultValue column in DataGridView Pin
El'Cachubrey27-Dec-06 4:08
El'Cachubrey27-Dec-06 4:08 
QuestionSelect satatment Pin
wmostafaw23-Dec-06 21:31
wmostafaw23-Dec-06 21:31 
AnswerRe: Select satatment Pin
rp_suman23-Dec-06 22:53
rp_suman23-Dec-06 22:53 
AnswerRe: Select satatment Pin
Cristian Amarie25-Dec-06 22:42
Cristian Amarie25-Dec-06 22:42 
AnswerRe: Select satatment Pin
albCode26-Dec-06 1:32
albCode26-Dec-06 1:32 
QuestionHow to fill null value for a column in Oracle Pin
NK723-Dec-06 9:35
NK723-Dec-06 9:35 
AnswerRe: How to fill null value for a column in Oracle Pin
Chris Meech24-Dec-06 12:08
Chris Meech24-Dec-06 12:08 
QuestionBuild Errors on SQL Statement Pin
Swisher2422-Dec-06 8:40
Swisher2422-Dec-06 8:40 
AnswerRe: Build Errors on SQL Statement Pin
Colin Angus Mackay22-Dec-06 10:14
Colin Angus Mackay22-Dec-06 10:14 
GeneralRe: Build Errors on SQL Statement Pin
Swisher2427-Dec-06 5:50
Swisher2427-Dec-06 5: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.