I am going to ask a question that might sound weird.
Is there a way to build a new class during Runtime? Or at least, add a new property to an existing class.
I mean creating a class that doesn't exist and not an instance of an existing class. I could later on use reflections to load and use this class.
...
I've been trying to get WCF security working for my project, and have had little luck. I'm trying to create a service that uses net.tcp as the binding, and does both message and transport security. Message security is done using username and password and transport security is done (supposedly!) using certificates.
For my development tes...
I am working on a application in .net.I want to do all calculation and then to print
all the information of the selected items on a given page of the company and then to
take the print of that page and also to save the same page in DB and send invoice to
the client through email in .pdf.
Please suggest.?
...
I am referring to exception messages that show the developer is incorrectly using an API. For example incorrectly passing a null to method. So the type of exception that the developer will get the first time they have run their incorrect code. The type of exception message that should never get to be displayed to the user of a system.
...
hi im new to c# and was trying to code but getting error
can anybody help me with this what am i doing wrong?
using System;
using System.Collections.Generic;
using System.Text;
namespace hodder
{
class Program
{
public static void Main()
{
isHodder(3);
}
static int isHodder(int n)
...
How do I create all the ASP.Net tables, sprocs etc in a database that already has data (non conflicting) in it.
...
I know this should be a basic question but I am hitting a brick wall.
I am looking to go to a URL/URI download the resulting string as if I had opened a file and then get it out into a String variable.
I have been stuffing about with IO.Stream and Net.httpxxx but haven't managed to get the elements to line up in the right way.
I get "t...
Hello,
We have several c# projects, libraries and solutions (a few asp.net applications, a few class libraries, windows applications like windows services and winform apps. etc.) which most of them depends each others output dlls. Some of our projects are grouped into solutions and they use project dependency. But some projects are not...
As I understand it I have to adorn a new member in a newer version of my class with the [OptionalField] Attribute when I deserialize an older version of my class that lacks this newer member.
However, the code below throws no exception while the InnerTranslator property was added after serializing the class. I check for the property to ...
What are the benefits to defining methods as "protected" in C#?
like :
protected void KeyDemo_KeyPress( object sender, KeyPressEventArgs e )
{
// some code
}
As compared to something like this:
private void FormName_Click( object sender, EventArgs e )
{
//some code
}
I've seen in books many examples and I don't understand ...
Hi,
i have a cache that uses WeakReferences to the cached objects to make them automatically removed from the cache in case of memory pressure. My problem is that the cached objects are collected very soon after they have been stored in the cache. The cache runs in a 64-Bit application and in spite of the case that more than 4gig of mem...
Over the course of the last couple of hours I have been tracking down a fairly specific bug with that occurs because another application has the clipboard open. Essentially as the Clipboard is a shared resource (as per "Why does my shared clipboard not work?") and you attempt to execute
Clipboard.SetText(string)
or
Clipboard.Clear()....
This seems to be pretty straight forward. I need to send email from some ASP.NET applications. I need to do this consistently without strange errors and without CPU utilization going through the roof. I'm not talking about mass emailing, just occasional emails.
System.Net.Mail appears to be horribly broken. The SmtpClient does not issue...
I am pretty new to MVC and hope that I am approaching this the correct way. Any input or advice would be great.
I would like to have a thumbnail view of an image load normally and when a user clicks on the image, the dynamic picture loads using the colorbox jquery plugin.
The problem is when you click on the smaller image, the dynamic...
Duplicate
Is there any one website which contains many good C# screencasts?
C# Training videos
So can anyone recommend a set of videos for learning C# preferably free ( in my experience the nonfree videos seem to lean moe towards shlock ),
I understand that some universities are now using C# as their "101" language.
D...
When you derive from a class and instance the subclass, the runtime also instances the super class, right?
Since abstract classes can't be instanced, are they not created by the runtime when a subclass is instanced?
If so, then abstract class inheritance would be faster than normal class instance?
...
Hi,
Is it acceptable for interfaces to declare properties instead of methods?
Which is more preferred?
interface ITaggable { string GetTag(); }
or
interface ITaggable { Tag {get;} }
Living in the .Net world.
Kind regards,
...
For a reference type (class) like Point3 (for example), is this an overkill, lacking:
#region System.Object Members
public override bool Equals ( object obj )
{
//return this == ( Point3 ) obj;
if ( obj == null )
{
return false;
}
if ( this.GetType ( ) != obj.GetType ( ) )
...
When I try to run Unit Tests (mstest) I run into this issue.
The line of code:
_mainCnStr = System.Configuration.ConfigurationManager.
ConnectionStrings["main"].ConnectionString;
Comes back as a null reference
It doesn't do this in the main UI project when I run it. What is the right method to get this connection str...
I'm very interested in using NHibernate.Burrow for my session handling and DAO in my ASP.NET app but I'm having trouble with the configuration. Burrow requires an XML NHibernate config for setting up its persistence but I don't have a config file since I'm using Fluent NHibernate to generate my config. So is there a way of letting Burrow...