Click here to Skip to main content
15,887,273 members
Home / Discussions / C#
   

C#

 
Question555555555555 Pin
winssss17-Aug-10 23:37
winssss17-Aug-10 23:37 
AnswerRe: 555555555555 Pin
Thomas Krojer18-Aug-10 1:24
Thomas Krojer18-Aug-10 1:24 
AnswerRe: 555555555555 Pin
Sauro Viti18-Aug-10 3:43
professionalSauro Viti18-Aug-10 3:43 
QuestionWCF host instant and open programmatically - how to relate to binding in app.config? Pin
1eyhk117-Aug-10 23:30
1eyhk117-Aug-10 23:30 
Questioncharacter postion replacemenet Pin
annie_bel17-Aug-10 23:28
annie_bel17-Aug-10 23:28 
AnswerRe: character postion replacemenet Pin
Gonzalo Cao17-Aug-10 23:51
Gonzalo Cao17-Aug-10 23:51 
GeneralRe: character postion replacemenet Pin
ps_prakash0218-Aug-10 4:27
ps_prakash0218-Aug-10 4:27 
QuestionDataSet does not support System.Nullable<> Pin
treuveni17-Aug-10 23:24
treuveni17-Aug-10 23:24 
Hi,

I've a function tht converts IEnumerable To DataTable,
my problem is that one off the columns allowes Nullable
and then i get this exception-
DataSet does not support System.Nullable <>

here is part of my function-
foreach (PropertyInfo pi in pis)<br />
            {<br />
<br />
                   if (dt.Columns.Count == 0)<br />
            {<br />
                foreach (PropertyInfo pi in pis)<br />
                {<br />
                    dt.Columns.Add(pi.Name, pi.PropertyType);<br />
                }<br />
            }                



i tried to change the function to-

if (dt.Columns.Count == 0)<br />
            {<br />
                foreach (PropertyInfo pi in pis)<br />
                {<br />
                    Type propType = pi.PropertyType;<br />
                    if (propType.IsGenericType && propType. == typeof(System.Nullable))<br />
                    {<br />
                        propType = Nullable.GetUnderlyingType(propType);<br />
<br />
                    }<br />
<br />
                    dt.Columns.Add(pi.Name, pi.PropertyType);<br />
                }<br />
            }

but i'm still getting the exception: D'Oh! | :doh:

+ pi {System.Nullable`1[System.DateTime] "myColumnName"} System.Reflection.PropertyInfo {System.Reflection.RuntimePropertyInfo}

What i'm doing wrong?
AnswerRe: DataSet does not support System.Nullable Pin
Bernhard Hiller18-Aug-10 4:24
Bernhard Hiller18-Aug-10 4:24 
AnswerRe: DataSet does not support System.Nullable Pin
Madmaximus7-Jul-11 4:48
Madmaximus7-Jul-11 4:48 
QuestionSD Card Pin
dataminers17-Aug-10 22:21
dataminers17-Aug-10 22:21 
AnswerRe: SD Card Pin
R. Giskard Reventlov17-Aug-10 22:32
R. Giskard Reventlov17-Aug-10 22:32 
AnswerRe: SD Card Pin
Thomas Krojer18-Aug-10 1:25
Thomas Krojer18-Aug-10 1:25 
QuestionBit Shifting problem Pin
norjali17-Aug-10 21:15
norjali17-Aug-10 21:15 
AnswerRe: Bit Shifting problem Pin
DaveyM6917-Aug-10 21:25
professionalDaveyM6917-Aug-10 21:25 
GeneralRe: Bit Shifting problem Pin
norjali17-Aug-10 21:28
norjali17-Aug-10 21:28 
AnswerRe: Bit Shifting problem Pin
Richard MacCutchan17-Aug-10 21:26
mveRichard MacCutchan17-Aug-10 21:26 
GeneralRe: Bit Shifting problem Pin
norjali17-Aug-10 21:30
norjali17-Aug-10 21:30 
GeneralRe: Bit Shifting problem Pin
norjali17-Aug-10 21:53
norjali17-Aug-10 21:53 
GeneralRe: Bit Shifting problem Pin
Richard MacCutchan17-Aug-10 22:18
mveRichard MacCutchan17-Aug-10 22:18 
QuestionDataadapter and datasets issue Pin
maephisto00717-Aug-10 20:44
maephisto00717-Aug-10 20:44 
Questioncache the name using input param.. Pin
A.Machan Kachan17-Aug-10 17:56
A.Machan Kachan17-Aug-10 17:56 
QuestionHow to convert any object to byte[] without marking it Serializable or DataContract? Pin
1eyhk117-Aug-10 16:35
1eyhk117-Aug-10 16:35 
AnswerRe: How to convert any object to byte[] without marking it Serializable or DataContract? Pin
Gonzalo Cao17-Aug-10 20:56
Gonzalo Cao17-Aug-10 20:56 
GeneralRe: How to convert any object to byte[] without marking it Serializable or DataContract? Pin
1eyhk118-Aug-10 1:51
1eyhk118-Aug-10 1:51 

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.