.net

Instantiate a ConfigurationSection from a different source

Is it possible and how to instantiate a custom System.Configuration.ConfigurationSection derived class from a different source (not dependent on App.config)? Here is what i want to get: [TestMethod] public void WorkWithALoadedConfiguration() { ProjectConfiguration projectConfiguration = LoadProjectConfiguration(filenameOrStreamOrXE...

running .net application over a network

Hello, I need some advice please. I need to enable a .Net application to run over a network share, the problem is that this will be on clients network shares and so the path will not be identical. I've had a quick look at ClickOnce and the publish options in VS2008 but it wants a specific network share location - and I'm assuming thi...

Get NativeEnglishName from iso currency symbol without dependency to the current culture of logged in user

Hello, what I have is the currencyIsoCode "EUR". This Property can also be found in the RegionInfo class => ri.ISOCurrencySymbol. But the RegionInfo class depends on the current logged in user. What I want is to get the NativeEnglishName like "Euro" even when the user is from en-De, en-Us, cn-CN etc... How can I do that? ...

What's next after .Net?

I'm wondering where other .Net developers see their future? I'm currently pretty comfortable with .Net after 8 years of development and now seem to spend more time learning the additional frameworks than the core language features. Is it likely that .Net will keep expanding with new frameworks as the need arises or do people feel tha...

Problem with SubSonic's SimpleRepository.Exists

I've got the following code: UserLoginData userLoginData = _securitySoap.Login(username, password); _repository = new SimpleRepository(SimpleRepositoryOptions.RunMigrations); _repository.Add<UserLoginData>(userLoginData); var queryResult = _repository.Exists<UserLoginData>(x => x.UserName == userLoginData.UserName); The last line thro...

asp.net connection reset with long running process

In an asp.net web form, I keep getting a connection reset error message. The page is doing a some long running processing (about 2-5 minutes). I have no problem when the web request comes from the same machine as the web server. But when the request originates across the network, I get a connection reset error about 1:30 or 2 minutes in...

What is the best way to determine if table already has record with specific ID?

Hello. I have a short question. Im my current project I'm using LINQ-to-SQl. That is the best way to determine if table has record with specific ID? Thanks in advance. ...

WebBrowser.Print() wait until complete. .NET

I am using a WebBrowser control in VB.NET and calling the Print() method. I am printing out using a PDF printer and when Print() is called it is not immediately kicked off (it waits until it has completed running code for the entire Sub or block. I need to make sure the file I am printing too is complete and continue process with this ...

How does Unity.Resolve know which constructor to use?

Given a class with several constructors - how can I tell Resolve which constructor to use? Consider the following example class: public class Foo { public Foo() { } public Foo(IBar bar) { Bar = bar; } public Foo(string name, IBar bar) { Bar = bar; Name = name; } public IBar Bar ...

Best way to manipulate XML in .NET

I need to manipulate an existing XML document, and create a new one from it, removing a few nodes and attributes, and perhaps adding new ones, what would be the best group of classes to accomplish this? There are a lot of .NET classes for XML manipulation, and I'm not sure what would be the optimal way to do it. ...

.NET Debugging - System.Threading.ExecutionContext.runTryCode

We have this bug that only appears 30% of the time for the Release build. Opening the crash dump in WinDbg (snipped "!analyze -v" output): FAULTING_IP: +4 00000000`00000004 ?? ??? EXCEPTION_RECORD: ffffffffffffffff -- (.exr 0xffffffffffffffff) ExceptionAddress: 0000000000000004 ExceptionCode: c0000005 (Access violatio...

LinqToSQL _conn ? LinqToSQLConnection ?

here is a code : using System; using Nemerle.Collections; using Nemerle.Text; //using Nemerle.Utility; using System.Linq; using Nemerle.Data.Linq; using NUnit.Framework; using System.Data.Linq; namespace LinqTestes { [TestFixture] public class Linq2SqlTests { static ReadConnectionString() : string { def currAssm = ...

How does the following regex pattern work?

Hi all, I'm horrible with regex but i'm trying to figure out how an import function works and i came across this regex pattern. Maybe one of you can help me understand how it works. string pattern = @"^""(?<code>.*)"",""(?<last_name>.*)"",""(?<first_name>.*)"",""(?<address>.*)"",""(?<city>.*)"",""(?<state>.*)"",""(?<zip>.*)""$"; Regex ...

Is there a way to access PrepertyInfo from attribute assigned to a propery

I have a custom attribute and I need to have the name of the property that it is on. Write now the name is just a string parameter in the attribute constructor. It works, but just doesn't feel write. Current Implementation [ListViewColumnDescription("Key", 1, "My Key", true)] public Guid Key { get; set; } Would like somethi...

.NET database enumeration

In a project, one of my entities is House which has many enumeration properties (for example housetype). Using .NET, Linq to Sql and Sql Server how can I create a db with enumeration and use it with Linq to Sql? What should be my approach? ...

Tag problem c# listbox

Hi i'm trying to use the tag item of a listbox. heres my code. int number = 0; foreach (ListViewItem item in listBox1.Items) { Tag tag = (Tag) item.Tag; saveSlide(showid, tag.photoid, enumber); number++; } problem im havin is when i run t...

Linq to object - Select Distinct

Hi, I can't quite figure out why this Linq Statement isn't working as i would expect: Dim distinctSurchargesList = (From thisparent As Parent In ThisParentCollection _ From thisChild As Child In thisparent.theseChildren _ Select New With {.childId = thischild....

Stack Trace in error in Webpage in ASP not in my code?

I'm new to web-development in ASP, and I'm experiencing a problem where I try to access a certain page through a link and I get an error, the first part says it's an exception, then tips on debugging and then the stacktrace. What happens is that this code isn't on my application, I've had errors like this before, and the peace of code t...

Sending mail using SmtpClient in .net

I am unable to send the mail using smtp client. here is the code: SmtpClient client=new SmtpClient("Host"); client.Credentials=new NetworkCredential("username", "password"); MailMessage mailMessage = new MailMessage(); mailMessage.from="[email protected]"; mailMessage.To.Add("[email protected]"); mailMessage.body="body"; mailMessage.su...

Render an asp.net control from a text string

Hi All, I'm not sure if it is possible to render an asp.net control from a string. The string contains fragments of html code and I've tried rendering that string to a div tag with runat="server" set, asp panel contain, asp lalbel control and asp literal control. All of them doesn't render the asp control in that text to an actual contr...