How to eliminate the usage of a nullable bool
I came up with this code, which I thought was rather clever (the requirement is that if the selected date is in the past, the TextBoxes should be readonly, otherwise (today's date or a future date) …
Preg Replace text to links with domains filter
Hello everyone i have a problem I have a text $text = " some and text http://www.somelink2.com/html5.jpg and some text http://www.somelink.net/test/testjava/html5.html#fbid=QTb-X6fv5p1 some ...
Windows 8 metro apps Share Target Issue C#
i have a problem that, I am sharing image through URI in metro app, but in my target app shows share image but not save in disk. please help me
Select nodes from the node in htmlagility pack
I have html body and I use this code to select particular piece of code and then, wiht the second line, I try to isolate other elements which are part of that particular node. HtmlNode node = ...
ContextMenuOpening event not firing in WPF?
I have a resource dictionary inside which I have a context menu: <ResourceDictionary x:Class="MyApp.Components.MyContextMenu" ...
MasterPage needs property from generic class derived from System.Web.UI.Page
I have two classes that are derived from an abstract generic class, which is derived from System.Web.UI.Page. I have a System.Web.UI.MasterPage that may or may not be the master for either of my two …
Passing Values to a Crystal Report
I am not able to load this report based on the following code: ReportDocument crystalReport = new ReportDocument(); ParameterField paramField = new ParameterField(); ...
LINQ to Entities Does not Support Invoke
I have the following query in LINQ to Entities: var query = from p in db.Products where p.Price > 10M select p; At this point the query has not executed, and I want to …
Redirect response to download file
I have a generic handler that I call using this very basic js code: var formData = new FormData(); formData.append("fileId", this.model.get("id")); xhr = new XMLHttpRequest(); ...
Writing to a text file on form closing event
I am trying to write some strings to a text file on the formclosing event. The problem is that the streamwriter doesn't write anything, it just writes a blank slate. I have 2 different text files, …
Merge two tables, inheriting values from one to another
I have two tables that I would like to display as a single result, using UNION or other technique. The ID field relates both tables. The second table has one field missing, so that missing value ...
Web Service(asp.net) -> VPS ->APNs
Well, i have an desktop application with a database and a web service in a IIS server (.net) I think, i must make a server (VPS), for communicate with APNs, and APNs communicates with the iOS app. …
Bad practice to have a Response.Redirect within a class in ASP.NET?
Within my ASP.NET App I am using a Method to check user permissions to decide whether the user can view the page, or get redirected to the "Invalid Permissions" page. Since adding this Permission ...
How to manage Migrations in a project with multiple branches?
I have an ASP.NET MVC3 project that uses Entity Framework 4.3 with the code-first approach. I use Migrations to keep the database up-to-date. The project is under source-control and I have a number …
PNG file Content-Type is Text from Response.ContentType
I have the following code in a module to direct the input from Response back to the browser. The problem is that I have a couple of PNG file from the 3rd party application that are not being rendered …
Throw statement outside of catch statement
Is it possible to use throw statement outside of try{} catch(){} statement? In my code(Plugin programming in CRM 2011) I just want to show a custom message to the user. If throw doesnot work then how …
Error while creating a Membership user “The password-answer supplied is invalid”
I tried creating a new user using CreateUser method. but when I click create user button I get this weird error : "The password-answer supplied is invalid". I already tried putting a strong password …
Using SQL for a Realtime Multiplayer Game Server's Working Data (Fast Enough?)
The game I'm working on currently has a Client in Flash AS3, and a Server in C# (multithreaded). Currently I use mySQL to handle logins (Raw access: no middleman for accessing the database) which ...
How to access c++ dll class in c# code
I have a C++ class in my 3rd party dll. If I call Assembly.LoadFrom(), VS throws up an unhandled exception as there is no manifest contained in the module. I can call global functions using ...
How do you query an int column for any value?
How can you query a column for any value in that column? Sometimes I would query for actual value (like 1, 2...) so I can't not have a condition either. Is there a wild card? select int_col ...
Wrapping words in a SQL query string with regex
i have a database class that is written in PHP and it should take care of some things i don't want to care about. One of these features is handling the decryption of columns that are encoded with the …
Proper use of the IDisposable interface
I know from reading the MSDN documentation that the "primary" use of the IDisposable interface is to clean up unmanaged resources. To me, "unmanaged" means things like database connections, sockets, …
How to get IP of VPN with the name “xyz” and if it is connected?
looking at "network connections" in windows server 2008, I have a connection called "company". How can I figure out if this VPN is currently connected and what internal IP(*) it has assigned? (*) …
Navigating through images in a database
Basically I have a page default.aspx that has an image control on it. When the page loads, that image control's url is set to ShowImage.ashx. The image is then populated with an image that is called …
Starting threads, logics for this type of functionality?
I have a logical problem i am not sure how to solve.. Basically i have a program that starts threads based on a numericUpDown value, if the user selects 5 in the numericUpDown box 5 threads will ...
Populate C# winforms Adobe PDF Viewer control from memory and not file system
I have a C# Winforms application that uses the Adobe PDF Viewer control to display PDFs. Currently I am having to save these PDFs from a web service (sent as a byte array) to a temporary file and ...
XQJ BaseX API in java shows different result for xquery than the BaseX application
Using the baseX application I constructed a XQuery that returned the result that I need. Using The XQJ BaseX API I implemented this same xquery so I can use these results in my java application. This …
Am I using lock properly here? Should I try and wrap less code with it?
I just inherited this code which is accessed by multiple threads. I just introduced two locks -- but I am wondering if there's anything else I should know. I have no significant experience working in …
Best Practices on Background Worker in C#
I am making my first ever C# GUI. It is using a BackgroundWorker to run a computationally heavy simulation. Periodically, the simulation reports (through the ProgressChanged event) a sizable body of …
Regular expression for matching n amount of parenthesis
I need to parse expressions of the following form: (S (A (B (D xyz)) (C m))) The amount of ( will always equal the amount of ), but there may be any arbitrary number of opening and closing ...