|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Allow nullsHi
How to get information from DataSet, allows the field NULL values or not? If i fill DataSet and read "MyDataSet.Tables("table").Columns("name").AllowDBNull" then this returns always True Regards; Meelis
Show quote
Hide quote
"Meelis Lilbok" <meelis.lil***@deltmar.ee> wrote in message How are you loading the schema for the data? are you filling this from a news:eudJE2ATGHA.4600@TK2MSFTNGP11.phx.gbl... > Hi > > How to get information from DataSet, allows the field NULL values or not? > > If i fill DataSet and read > "MyDataSet.Tables("table").Columns("name").AllowDBNull" > then this returns always True > > > Regards; > Meelis > > sql database or some fashion like that? I think the problem is that no schema is loaded so it doesn't know if AllowDBNull is true or false based on the source table. Hi James
This "schema" thing is unknown for me :)) Im filling dataset from SQL database and then try to get DataType like this MyDataSet.Tables("table").Columns("name").AllowDBNull Meelis Show quoteHide quote "James Jardine" <james.jard***@geoage.com> wrote in message news:%23YN1VeFTGHA.4452@TK2MSFTNGP12.phx.gbl... > > "Meelis Lilbok" <meelis.lil***@deltmar.ee> wrote in message > news:eudJE2ATGHA.4600@TK2MSFTNGP11.phx.gbl... >> Hi >> >> How to get information from DataSet, allows the field NULL values or not? >> >> If i fill DataSet and read >> "MyDataSet.Tables("table").Columns("name").AllowDBNull" >> then this returns always True >> >> >> Regards; >> Meelis >> >> > How are you loading the schema for the data? are you filling this from a > sql database or some fashion like that? I think the problem is that no > schema is loaded so it doesn't know if AllowDBNull is true or false based > on the source table. >
Show quote
Hide quote
"Meelis Lilbok" <meelis.lil***@deltmar.ee> wrote in message You have to call the FillSchema method of your dataadapter before you call news:Om0pV8LTGHA.4752@TK2MSFTNGP10.phx.gbl... > Hi James > > This "schema" thing is unknown for me :)) > > Im filling dataset from SQL database and then try to get DataType like > this > MyDataSet.Tables("table").Columns("name").AllowDBNull > > > Meelis > > > > "James Jardine" <james.jard***@geoage.com> wrote in message > news:%23YN1VeFTGHA.4452@TK2MSFTNGP12.phx.gbl... >> >> "Meelis Lilbok" <meelis.lil***@deltmar.ee> wrote in message >> news:eudJE2ATGHA.4600@TK2MSFTNGP11.phx.gbl... >>> Hi >>> >>> How to get information from DataSet, allows the field NULL values or >>> not? >>> >>> If i fill DataSet and read >>> "MyDataSet.Tables("table").Columns("name").AllowDBNull" >>> then this returns always True >>> >>> >>> Regards; >>> Meelis >>> >>> >> How are you loading the schema for the data? are you filling this from a >> sql database or some fashion like that? I think the problem is that no >> schema is loaded so it doesn't know if AllowDBNull is true or false based >> on the source table. >> > > your .Fill. This will fetch the allowDbNull information from the database. Of course.. this increases the number of trips to the database but if you need the information this is how you get it. http://msdn2.microsoft.com/en-US/library/229sz0y5(VS.80).aspx this link is to 2005 but it is the same concept as 2003 and 2002. |
|||||||||||||||||||||||