blah blah blah is here! blah blah » Close

0
votes
1 answers

What's the difference?

AK01
15

first [code]foreach (DataRow row in Table01.Rows) { int count = row.Field<int>(0); string name = row.Field<string>(1); } [/code] second [code]foreach (DataRow row in Table01.Rows) { int ...

1
votes
2 answers

Why can't you cast to a primitive type like long when its an object?

Rick_A
761

I don't understand why, in c#, I cant' cast an object who's value is an integer to a type long. For example: [code]int x = 4; long y = (long)x; Console.WriteLine("y = " + y); // works Object obj = 4; Console.Wri ...

1
votes
2 answers

Is it safe to cast an entire collection and assign it to new collection of another type?

I have a List<Articles> collection. The class Articles implements IContent. I want the method to return a collection of IContent, List<IContent>. I want to do something like: List<IContent> content = articlesList ...

3
votes
1 answers

Cannot Implicity Convert 'String' To 'System.DateTime'

Hi, i'm trying to debug this line of code: [code] dateTimePicker1.Value = ap.Start.ToString("dd/MM/yyyy HH:mm:ss", null); [/code] but keep getting the folowing error? Cannot Implicity Convert 'String' To 'System.DateTim ...

Feedback