If i have an interface, which i add comments to to identify that a specific exception will be thrown, is it ok for implementing classes to throw different exceptions?
A (bad) example is:
public interface IWidgetWorker {
/// <summary>
/// Do the work required for the specified work id.
/// </summary>
/// <param name="wor...
There must me a more elegant way to build a URL with parameters in .NET then for example
Response.Write("<a href=HeadOfMarketView.aspx"+Session["HOM"] != null ? Session["HOM"]+">Head of Market</a> / ")
I mean the concatenation of strings is a litte bit old school, no?
...
Hi,
i have problem of uploading zip file ot server from my windows mobile..
in server the .zip file is getting created,if i open file its telling unable to open and its corrupted
here is code
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(uploadUrl);
req.Method = "PUT";
req.AllowWriteStreamBuffering = true;
...
Hello.
.NET v2
When the List has a very useful (4 me) method AsReadOnly()
the LinkedList does not have such a method.
Is there a way to "quickly" interface an internal LinkedList to read only from the external code?
...
hello,
what is the preferred method to pass a string between C++ and C#?
i have a c++ class where one of the functions takes a char const * const as parameter.
how would i call this function in C#? just using a c#-string doesnt seem to work as the function in C# requires a sbyte*
C++ class:
public ref class MyClass
{
public:
void S...
I like stylecop and we use it to enforce coding standards.
I dont like the fact that there is no way to automatically fix problems. So was thinking of making a plugin. Once I realised that 2010 is better for doing this I backtracked.
I've been looking for an existing tool to help automate this process and have come across stylecop for ...
I have a number of methods doing next:
var result = command.ExecuteScalar() as Int32?;
if(result.HasValue)
{
return result.Value;
}
else
{
throw new Exception(); // just an example, in my code I throws my own one
}
I wish I could use operator ?? like this:
return command.ExecuteScalar() as Int32? ?? throw new Eception();
but ...
Hello,
can you tell me how to create setup file dynamically in c#.net or VB.Net.
Please reply me soon
Samir
...
What is the default capacity of a List?
...
Hi.
Inside my aspx file, I have the following html code inside an repeater: <div class="someItem ">.
Now, if Eval("Approved") == true, then I would like to add the class approved to the div.
So the new html would be <div class="someItem approved">.
I tried doing something like this:
<%# if(Eval("Approved")) approved %>
But that d...
Hi,
I just read this --> Configuring ClickOnce Trusted Publishers and got it running at another computer on network. I deployed the application on network itself (i.e. \\abc\something ).
Though I could not find certmgr.exe as part of Windows core component, as the article says ( ..so you will need to use the certificate management c...
Dear ladies and sirs.
I use NHibernate as my DAL. My objects are versioned. I have noticed that when I save an object, NHibernate sets the mapped properties again. It all starts in the AbstractSaveEventListener.PerformSaveOrReplicate method, which decides to "substitute" the values.
Anyway, here is the stack trace:
NHibernate.dll!NHib...
In a .NET application (written in C#) I have a UI with a list and a text box used to enter a filter string to filter what is displayed in the list. I refresh the filter as the user types.
I now want to allow use of regular expressions in the filter string, which poses a problem. As the user types the expression it may be invalid, for in...
I've been asked to make one of the components, which mimics a real-world appliance, in our application have a custom appearance, which varies depending on the make of the appliance being mimicked, so I need to make it skinnable.
Now, I'm aware that the best way to do custom appearances in user interfaces, is not to do that at all; but I...
Dear ladies and sirs.
My scenario is this. We use NHibernate as our DAL. Each and every object fetched by it, be it a single object, a collection of objects or even child objects - whatever, we have to perform certain post processing.
Currently, this custom post processing is spread around - after each fetch. I am wondering if I could ...
Hi All,
Currently decryption/encryption and signature validation is implemented in my BTS application by using custom pipeline component which internally uses pipleline assembly that is the BTS assemblies, I was thinking of shifting the message encryption/decryption logic to the web service layer so that once messages are authenticated/...
I'm looking into Productivity tools for developing in C# / Visual Studio 2008 (pr0) and developing web apps (not using MVC).
Anything from favourite visual studio shortcuts to external tools and plug-ins.
...
Hello,
Last months I've been busy creating a .NET Webservice with several functions and a website written in html and Javascript which acts as the user interface and calls the webservice methods with JSON. The webservice returned JSON responses and it did work very well. Then I concentrated on the webservice to finish all the functional...
Ahh, don't you just love a good ternary abuse? :) Consider the following expression:
true ? true : true ? false : false
For those of you who are now utterly perplexed, I can tell you that this evaluates to true. In other words, it's equivalent to this:
true ? true : (true ? false : false)
But is this reliable? Can I be certain that...
Here is the scenario:
There are some domain objects
There are some WCF services exposing business services that interact with these domain objects
There is a WPF application that is the UI, which calls the WCF services
A pretty common set-up I would have thought. I am thinking of using DTOs between the WCF service and WPF app. There ...