I can't do this in C#:
catch (Exception exception)
{
var wrappedException = new TException(exception);
}
Getting error "cannot provide arguments when creating an instance of type parameter 'TException'. Just wanted to check with the community to see if there is any way to do something like this?
...
I have a ASP.NET MVC 2 app I am building and users are allowed to post data in certain sections. I would like to display the "Posted At" in the same format that Stackoverflow and Facebook do.
i.e. On this site when I post this question it will display "asked 3 seconds ago" then "asked 3 mins ago" and after a few day it will display the...
I would like a brief and easy way to strip tags from an XHTML document, and believe there has to be something curt enough among all the options like: XSLT, XPath, XQuery, custom C# programming using the .NET XML namespace. I'm open to others.
For example, I want to strip all <b> tags from an XHTML document but
keep their inner cont...
There seems to be lots of great Object Relational Mappers out there - several of which I have used myself (LLBLGen being one I like a lot). Does anyone know of any .Net tools out there to help build a rich Data Access layer when the DataSource is not a database - or more specifically, where the datasource is multiple, highly granular, we...
Hello, I am writing a test for my library written in C#. And I want to test whether two list are same if and only if they have same elements(do not require elements in the same order). I try to convert list to hashset and check whether the two hashset are same. But the running result is not what I expected.
Could anyone explain how the...
First off I have RFM and RFM and I have tried to follow a few sites but I cannot grasp the concept of the Resource Manager.
Can someone please explain to me how to generate a resource manager similar to that of the VS IDE.
For example if I compile with VBC from the commandline I can see all my resource files.
vbc /t:exe myfile.vb /...
What's the best way to build a service to handle queued long-running processes? For example, this is what we're trying to do
User uploads 401k data to web
Data goes into processing queue (a database table)
401k is processed (could take a couple minutes per client)
User is informed via e-mail that 401k was accepted
We could certainly...
I am translating a C++ project to C#. Say the original C++ project name is called Company.Project.SubProject. What is a good name for C# version? Please advise, thanks.
EDIT:
Since if both C++ and C# projects are all called Company.Project.SubProject, it would be a bit confusing to distinguish them in TFS or so.
...
There are a lot of files that have changed unintentionally and now they don't match their related schema.
What I want to do is to find the errors and to correct them automatically (if possible).
I looked at the validation mechanism available in .NET framework. The problem is I don't know how I can edit the erroneous node.The validation ...
Yes, I am using a profiler (ANTS). But at the micro-level it cannot tell you how to fix your problem. And I'm at a microoptimization stage right now. For example, I was profiling this:
for (int x = 0; x < Width; x++)
{
for (int y = 0; y < Height; y++)
{
packedCells.Add(Data[x, y].HasCar);
packedCells.Add(Data[x, ...
Hi all,
I have the following web service method (.ASMX file):
[WebMethod(EnableSession = true)]
[ScriptMethod(ResponseFormat = ResponseFormat.Json)]
public GetTruckBasicReturnedObject GetPollBasic(ulong truckId)
{
return new GetTruckBasicReturnedObject();
}
Any time I uncomment this method, when I try to get to the service test pa...
I am looking into creating an Public API so that we can open up some functions to our clients to develop against. I am sure that there are some good frameworks out there, I am just not sure where to start looking.
There are 2 things that this framework would need to achieve.
The Ability to approve/deny developers against the API. Th...
Possible Duplicate:
Finalize vs Dispose
Hi,
Recently I was quizzed in an interview about finalize and dispose. When is each one of them used and how is Garbage Collector related to them. Kindly share links to enlighten more on the topic.
Kindly share ...
Thanks in advance.
...
Im using an P/invoke on an unmanaged dll function swe_calc_ut.
int swe_calc_ut(double tjd_et, int ipl, int iflag, double *xx, char *serr)
Parameter xx is meant to be an "array of 6 doubles for storing the result", and parameter serr a "character string to return error messages"
my c# code is as follows.
[DllImport("swedll32.dll")]...
I have created a dbml file in my project, and then dragged two tables from a database into the designer. This is the tables for order header and order lines, and order lines have a foreign key to order header to make it a one to many relationship.
As soon as the two tables are dragged onto the designer, the association arrow appear and ...
I am doing some weekend coding exercises. I have a table that contains some information about, say, a customer or user. Now I want to store images for this user. I have two choices:
Save the image from user class to the same
table that contains other user information.
Save the image to a new table which I can create on separate filegro...
I'm trying to assign a value with code like the following:
findItemByCategoryRequest r = new findItemByCategoryRequest()
r.outputSelector = outputSelectorType.SellerInfo
........etc
However I am getting an error when I try to build:
"Cannot implicitly convert type 'FinalEbayParser.com.ebay.developer.OutputSelectorType'
to 'FinalEbay...
Im using P/invoke on an unmanaged dll function swe_get_planet_name() in C#.
The given function definition is,
char* swe_get_planet_name(int ipl, char *spname);
This means the return value is assigned to char *spname? It seemed so from the sample code in the documentation.
char snam[40];
/*
* get the name of the planet p
...
Need to modify Log4PostSharp project by inheriting from the ready-made (and working) custom attribute. It looks similar to this:
[AttributeUsage(
AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Module | AttributeTargets.Struct,
AllowMultiple = true,...
I'm using C# , .NET and SQL Server with Linq2SQL.
What does this error mean?
Is it a insert or read/select related error?
The function Classes.BLL.Save(LPage l) first selects COUNT from database and then INSERT a new record to database.
2010-09-03 04:57:56,264 System.Data.SqlClient.SqlException (0x80131904): Timeout expired. The tim...