.net

.net COM+ object that returns IDataReader

I've created a .net class derived from ServicedComponent and registered it with COM+. The interface that this component implements has a method that returns an IDataReader. When I call the serviced component from my client application everything works I can call the method that returns the IDataReader no problem but as soon as I call a...

LINQ to XML Newbie Question

Greetings! I'm working on wrapping my head around LINQ. If I had some XML such as this loaded into an XDocument object: <Root> <GroupA> <Item attrib1="aaa" attrib2="000" /> </GroupA> <GroupB> <Item attrib1="bbb" attrib2="111" /> <Item attrib1="ccc" attrib2="222" /> <Item attrib1="ddd" attrib...

Could not load type from assembly error

I have written the following simple test in trying to learn Castle Windsor's Fluent Interface: using NUnit.Framework; using Castle.Windsor; using System.Collections; using Castle.MicroKernel.Registration; namespace WindsorSample { public class MyComponent : IMyComponent { public MyComponent(int start_at) { this....

Access Intranet via SSL using WebBrowser Winforms Control

I have a .Net 2.0 app that is used internally and we want to use the WebBrowser control to access some Web resources. We want to add encryption to these sites using SSL using self signed certificates. My question is if there is way to disable all the warnings about the SSL keys coming from an untrusted source? I would like to avoid to h...

How to get the application executable name in Windows (C++ Win32 or C++/CLI)?

I need to change the functionality of an application based on the executable name. Nothing huge, just changing strings that are displayed and some internal identifiers. The application is written in a mixture of native and .Net C++ code. Two ways that I have looked at are to parse the GetCommandLine() function in Win32 and stuffing aro...

Windows Forms textbox that has line numbers?

I'm looking for a free winforms component for an application I'm writing. I basicly need a textbox that contains line numbers in a side column. Being able to tabulate data within it would be a major plus too. Does anyone know of a premade component that could do this? ...

Synchronize a DataSet and DataTables with Database

I am using ADO.net with a DataSet and DataTables for the first time and I have run into a pretty significant problem. Each time that I change anything in my database table definitions, I don't seem to have an easy way to synchronize these changes to my DataTable definitions in my DataSet. So far, it has been quick to simply delete my Da...

Should Usings be inside or outside the namespace

I have been running StyleCop over some C# code and it keeps reporting that my using statements should be inside the namespace. Is there a technical reason for putting the using statements inside instead of outside the namespace? Edit: There appears that there is no difference after compliation. The reasons for putting them inside the n...

Impersonation in .NET

Is there a simple out of the box way to impersonate a user in .NET? So far i have been using this class from code project for all my impersonation requirements. But is there a better way to do it,by using .NET framework, out of the box? I have a user credential set, (username, password, domain name) which represents the identity i need t...

Plugins wont work with vb.net express.

What won't plugins wont work with vb c# studio express? ...

Adding a web reference to a DLL which is GACed

I come across this problem when i am writing an event handler in SharePoint. My event handler has a web reference. When i create this web reference, the URL of the web service will be added in the .config file of the assembly. If i have to change the web reference URL i just have to change the link in the config file. Problem comes whe...

Generic LINQ query predicate?

Not sure if this is possible or if I'm expressing correctly what I'm looking for, but I have the following piece of code in my library repeatedly and would like to practice some DRY. I have set of SQL Server tables that I'm querying based on a simple user-supplied search field ala Google. I'm using LINQ to compose the final query based ...

Need to create a dynamic ConfigurationSection that also holds the type

I need to create a configuration section, that is able to store key-value pairs in an app.config file and the key-value pairs can be added runtime regardless of their type. It is also important that the value keeps its original type. I need to extend the following interface public interface IPreferencesBackend { bool TryGet<T>(stri...

Deploy multiple instance of reporting services or connect to multiple versions of DLLs

Is there any way in SSRS2008 to deploy multiple instances of the ReportServer running separate code sets? I'm developing a very specific deployment of reporting services where I have a number of custom extensions plugged in. But, my company typically deploys multiple versions of a release at once on the same server. I'm at a little bi...

.NET ODBC Connection Pooling

I open a connection like this: Using conn as New OdbcConnection(connectionString) conn.Open() //do stuff End Using If connection pooling is enabled, the connection is not physically closed but released to the pool and will get reused. If it is disabled, it will be physically closed. Is there any way of knowing programmaticall...

How do I call a webservice without a web reference?

I want to call a web service, but I won't know the url till runtime. Whats the best way to get the web reference in, without actually committing to a url. What about having 1 client hit the same web service on say 10 different domains? ...

WCF Application Caching Implementation

Hi Guys, i just wondering how the .net wcf application caching is implemented ?? It's single thread or multiple thread?? and if it's multiple thread how we enforce application caching to be single thread. Thank You :) ...

How can I programatically manipulate any Windows application's common dialog box? (.NET)

My ultimate goal here is to write a utility that lets me quickly set the folder on any dialog box, choosing from a preset list of 'favorites'. As I'm just a hobbyist, not a pro, I'd prefer to use .NET as that's what I know best. I do realize that some of this stuff might require something more than what I could do in C#. I have seen som...

Setting default language in EPiServer ?

I'm looking for a way to set the default language for visitors comming to a site built in EPiServer for the first time. Not just administrators/editors in the backend, people comming to the public site. ...

Managing ThreadPool starvation within a multithreaded work queue processor?

I am investigating the design of a work queue processor where the QueueProcessor retrieves a Command Pattern object from the Queue and executes it in a new thread. I am trying to get my head around a potential Queue lockup scenario where nested Commands may result in a deadlock. E.G. A FooCommand object is placed onto the queue which ...