laredo512 Posted August 29, 2004 Posted August 29, 2004 Joe, In the case where someone would want to use the IDE generated datasets with their automatically generated adapters (which themselves contain parameters), how would one make a Date field accept a DBNull value. Contrary to a typed, parameterized insert statement where this would work, the dataset does not permit a DBNull Value in its structure. any thoughts? thanks Quote Laredo512 * using VS.NET Pro 2003 *
Joe Mamma Posted August 29, 2004 Posted August 29, 2004 Joe, In the case where someone would want to use the IDE generated datasets with their automatically generated adapters (which themselves contain parameters), how would one make a Date field accept a DBNull value. Contrary to a typed, parameterized insert statement where this would work, the dataset does not permit a DBNull Value in its structure. any thoughts? thanks ??? hmmm - if the DataColumn.AllowDBNull = true of a DataTable Column within the dataset then it should. . . if it is not, then the error should be trapped and a prompt to the user should tell them they must specify a date. Likewise with the parameter. the parameter will be generated from SchemaInfo and should only have IsNullable set to false only if the relative column is not nullable. I could be wrong. . . Naw, I'm never wrong. . . Am I??? I Am??? Really?!? Quote Joe Mamma Amendment 4: The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no warrants shall issue, but upon probable cause, supported by oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized. Amendment 9: The enumeration in the Constitution, of certain rights, shall not be construed to deny or disparage others retained by the people.
laredo512 Posted August 29, 2004 Posted August 29, 2004 For the past 2 hours, I have been experimenting in that direction... :mad: all the date fields in my dataset are set to nillable = true and I still get the darn date overflow error OR the prepared statement. (.... the IDE insert statement ... .) expects the @strArrDate to be specified which was not. <<-- that happens because there is no date selected for strArrDate. strArrDate is now dim as object in case it is null. Mind you, I triple checked to make sure I included all 24 parameters. I have a feeling these IDE datasets dont like nulls. [code] Dim x as Object = System.DBNull.Value With Me.daInserCont .Connection.Open() .Parameters(0).Value = strMainID .Parameters(1).Value = strContainer .Parameters(2).Value = x .Parameters(3).Value = x .Parameters(4).Value = x .Parameters(5).Value = strContPickUp .Parameters(6).Value = strContDate .Parameters(7).Value = x .Parameters(8).Value = strContPUWaybill .Parameters(9).Value = x .Parameters(10).Value = x .Parameters(11).Value = x .Parameters(12).Value = x .Parameters(13).Value = strArrDate .Parameters(14).Value = strStorDate .Parameters(15).Value = decWeight .Parameters(16).Value = decCBM .Parameters(17).Value = decBoxes .Parameters(18).Value = x .Parameters(19).Value = x .Parameters(20).Value = x .Parameters(21).Value = strComments .Parameters(22).Value = gUserID .Parameters(23).Value = strDateNow .ExecuteNonQuery() .Connection.Close() End With [/code] I guess its time to start typing now before darkness falls on this program... Quote Laredo512 * using VS.NET Pro 2003 *
Joe Mamma Posted August 29, 2004 Posted August 29, 2004 when you trace through. . . what is the IsNullable state of the parameter in question. . . Might you be able to set that = true ? Quote Joe Mamma Amendment 4: The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no warrants shall issue, but upon probable cause, supported by oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized. Amendment 9: The enumeration in the Constitution, of certain rights, shall not be construed to deny or disparage others retained by the people.
laredo512 Posted August 29, 2004 Posted August 29, 2004 at the break point, the field is set as AllowDBNull = true However, I did notice that if no date is present, the system, for some stupid reason is not making my object System.DBNull.Value ... its set to Nothing.... <<<--- that has to be be problem... checking.... Quote Laredo512 * using VS.NET Pro 2003 *
laredo512 Posted August 29, 2004 Posted August 29, 2004 Whats the actual recommended time in front of a code windows before one can be declared officially insane and unfit for public outings? <<< been at this too long... KIT KAT!!! where is it !!!! I found the prob... the nothing somehow slipped into one of the variables in my code. Using the IDE generated parameters saved me a ton of code.... Thanks for your help Joe, much appreciated Quote Laredo512 * using VS.NET Pro 2003 *
Joe Mamma Posted August 29, 2004 Posted August 29, 2004 Whats the actual recommended time in front of a code windows before one can be declared officially insane and unfit for public outings? <<< been at this too long... KIT KAT!!! where is it !!!! I found the prob... the nothing somehow slipped into one of the variables in my code. Using the IDE generated parameters saved me a ton of code.... Thanks for your help Joe, much appreciated here to serve. . . (is it day or night) Quote Joe Mamma Amendment 4: The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no warrants shall issue, but upon probable cause, supported by oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized. Amendment 9: The enumeration in the Constitution, of certain rights, shall not be construed to deny or disparage others retained by the people.
laredo512 Posted August 29, 2004 Posted August 29, 2004 Im in around Montreal QC... 4:38 PM Quote Laredo512 * using VS.NET Pro 2003 *
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.