I am in the process of converting some applications to C# by request of a client. I am new to C# so and have been stumped on some things. This is VS 3.5.
1)
I have a datarow that has a value in the ID column(Guid) and Title column (String). I am trying to set variables of the same type to the values of the datarow columns like so:
_id = dr["ID']
_title = dr["title"]
i am getting an error when building. Cannot implicitly convert type 'object' to 'Guid'. An explicit conversion exists (are you missing a cast?). Since the type is a uniqueidentifier (guid) from the query would that error converting guid to guid? There are times that the result set returns NULL so i don;t want to cast it. That would cause an error.
2)
In vb.net you can call a function and pass params in like so:
dothis( _
a, _
b, _
c)
in c# it won;t let you. You have to place them in a long string. I find that breaking the params into seperate lines is easier to read when you have some methods that have 20 or 30 params. is there an equivalent to this in c#?
3)
Is there an equivalent to the WithStatement in c#?
thanks all
j