Before I ask my question, please take a look at this example function:
DateTime.TryParse("01/01/2000", out oDate)
Why do I need to specify the out keyword? Shouldn't the compiler know this from the function's definition?
I'm asking this out of pure curiosity in the hope that I will learn something new about the compiler.
I should al...
Ok. So I have a list of values, and I'd like to do something like the following:
MyObjectValues
.Select(currentItems=>new MyType()
{
Parameter1 = currentItems.Value1,
Parameter2 = currentItems.Value2
});
So here's the problem. I need the above example to work with named constructors, such as:
MyObjectValues
.Select(curren...
I'm doing some WinForms development, running XP and VS 2005 (ancient, I know). I'd like to make sure my application can run without admin rights, but I'm too lazy to try to run VS as a non-admin, and I don't want to log in and out to test my app.
Is there a way I can just debug as a non-admin?
Is there a set of code access securit...
Is it ever possible in a managed system to leak memory when you make sure that all handles, things that implement IDispose are disposed?
Would there be cases where some variables are left out?
...
I am a bit rusty in my Java, and this is my first time using metro/JAX-WS, so if this is a dumb question I apologize.
I have to write a client that consumes a .NET webservice. I've got the basics down; I have generated the wrappers from the WSDL, and I can create my object and port and make a call and get a response.
Widgets d = new ...
I would like to write a web page where users can search a directory on NTFS for certain criteria and display the results.
Does the directory have to be indexed?
Is there a .NET accessible windows search API that I can use to query the directory?
...
Does anyone know how I can get the current line number of an System.Xml.XmlReader? I am trying to record where in a file I find Xml elements.
...
I have a PrintDocument that has several pages.
One page in that document must be in a Landscape orientations instead of Portrail.
As the PrintPage event is triggered for each page on the document... at the very begining of that event handler I set the PrintPageEventArgs.PageSettings.Landscape to true.
That doesn't works on THAT page......
I have set up a WCF service on a server which lives in its own Workgroup. I've tried to make a TCP/IP connection to it from a client that lives on the corporate domain. When I try to open a connection, I get a SecurityNegotiationException with the message:
"A remote side security requirement
was not fulfilled during
authentica...
Currently applications are deployed only to my office of 40 employees or so. ClickOnce works great for this as everyone has network access or VPN access which makes updating pretty straightforward. Now, it has been tasked to me to figure out the best way to deploy these applications to res of the company. ClickOnce would work but the ...
I'm loading horse genealogical data recursively.
For some wrong sets of data my recursion never stops... and that is because in the data there are cycles.
How can I detect those cycles to stop recursing?
I thougth of while recursing mantain a hashTable with all "visited" horses.
But that will find some false positives, because a horse ...
Hi folks.
i've got a LinqToSql query with a custom extension method at the end. this extension method is erroring when I try to linq2sql tries to generate the sql statement.
Error:
Method
'System.Collections.Generic.IList1[System.String]
ToListIfNotNullOrEmpty[String](System.Collections.Generic.IEnumerable1[System.String])'
h...
i can bind the dropdownlist in the edit item template. The drop down list is having null values.
protected void grdDevelopment_RowDataBound(object sender, GridViewRowEventArgs e)
{
DropDownList drpBuildServers = new DropDownList();
if (grdDevelopment.EditIndex == e.Row.RowIndex)
{
drpBuildServers = (DropDown...
There's a class which is compiled into a dll
//HeaderFile.h
//version 1.0
class __declspec(dllexport) A {
int variable;
//member functions omitted for clarity
};
//implementation file omitted for clarity
You build an exe which uses above class from the dll it was compiled into
#include "HeaderFile.h"
int main() {
A *obj = ...
System.Exception: There was an error reading the city list for CANANDA ---> System.ArgumentException: Unrecognized escape sequence. (1056):
{code: "CA",cities: [{name: "Abbotsford",lat: 49029998,lon: -122370002},{name: "Calgary",lat: 51119998,lon: -114019996},{name: "Edmonton",lat: 53299999,lon: -113580001},{name: "Halifax",lat: 448800...
I have read that removing unused references makes no difference to the compiler as it ignores assemblies that are not being referenced in the code itself.
But I find it hard to believe because then, what is the real purpose of Removing unused references? It doesn't have any noticeable effect on the size of the generated assembly or othe...
I've searched the IIS7 MSDN database but can't find any concrete material on how to create custom C#.NET extensions for IIS7, I know that previously in IIS6 you had to write an ISAPI extension in C++ if you wanted to say plug in your own scripting language for websites (this is sort of what I want to do) but in IIS7 you're supposed to be...
Here's some c# code
string webPageStr = @"<html><body><div id=""content"">good content</div><div id=""badcontent"">bad content</div></body></html>";
XmlDocument webPage = new XmlDocument();
webPage.LoadXml(webPageStr);
XmlElement divElement = webPage.GetElementById("content");
and divElement is equal null and i don't know why
I ha...
I want to generate a url from a tag name.
In my view (asp.net mvc) I have the following:
<%= Html.ActionLink(Html.Encode(tagName),
"tagged" //action,
"posts" //controller,
new {tagName=Html.UrlEncode(tagName)} //querystring argument,
new {@class="tag"} //html attributes)
%>
But this generates the following URL if the tagName i...
It appears that the DataContractSerializer isn't available in the .NET Compact Framework. I found this quite surprising, as I consider DataContractSerializer to be the Holy Grail of serialization, and one of the most widely useful classes introduced in .NET 3.
Is there a way to get the same functionality under the Compact Framework, tha...