C# code won't compile. No implicit conversion between null and int

C# code won't compile. No implicit conversion between null and int

Possible Duplicate: Nullable types and the ternary operator: why is `? 10:null` forbidden? Why doesn't this work? Seems like valid code. string cert=ddCovCert.SelectedValue; int? x=(string…


c# - Conditional operator cannot cast implicitly?

I'm a little stumped by this little C# quirk: Given variables: Boolean aBoolValue; Byte aByteValue; The following compiles: if(aBoolValue) aByteValue=1; else aByteValue=0; But this w…


How can I create a unique 7-digit code for an entity?

When a user adds a new item in my system, I want to produce a unique non-incrementing pseudo-random 7-digit code for that item. The number of items created will only number in the thousands(<10,000…


c# - How can I calculate what date Good Friday falls on, given a year?

Does anyone have a good algorithm to calculate what date Good Friday falls on given the year as an input? Preferably in C#.…


c# - Invalid URI: The format of the URI could not be determined

I keep getting this error. Invalid URI: The format of the URI could not be determined. the code I have is: Uri uri=new Uri(slct.Text); if(DeleteFileOnServer(uri)){nn.BalloonTipText=slct.T…


c# - StructureMap Exception Code: 202 No Default Instance defined for PluginFamily

I am new to StructureMap. I have downloaded and am using version 2.6.1.0. I keep getting the below error: StructureMap Exception Code: 202 No Default Instance defined for PluginFamily Compan…


Never defined structure

Is there any benefit in having never-defined structures in C ? Example in SQLite source code:/* struct sqlite3_stmt is never defined*/ typedef struct sqlite3_stmt sqlite3_stmt; And the object is ma…



c# - Invalid URI: The hostname could not be parsed

I am try to Construct Uri But i am unable to handle bad uri's Is there any way we can handle bad uri's if(reviews[e.Item.ItemIndex].URL.ToString().Contains("http:")){oURI=new Uri(reviews[e.…


C#: Dynamic runtime cast

I would like to implement a method with the following signature dynamic Cast(object obj, Type castTo); Anyone know how to do that? obj definitely implements castTo but needs to be cast properly in ord…


retreving long text(CLOB) using CFQuery

I am using CFQuery to retrieve the CLOB field from Oracle DB. If the CLOB filed contains the Data less than ~ 8000, then I can see retrieved the value(the o/p), however If the value in CLOB field…




the not cannot how for could error from and type