.net

Lookups in VB.NET Bogging Down LDAP Server

Hello All, My DBAs have informed me that one of my applications is really bogging down one of our LDAP servers. I've looked at the code several times, but I can't see any way to limit the amount of times I have to hit LDAP. So now I've decided to look at the way that I am actually obtaining the data to see if there is a better way. I...

Convert a String to Stream

I've download an image from the Internet and converted to a String (This is not changeable) Dim Request As System.Net.WebRequest = _ System.Net.WebRequest.Create( _ "http://www.google.com/images/nav_logo.png") Dim WebResponse As System.Net.HttpWebResponse = _ DirectCast(Request.GetResponse(), System....

.Net: Read properties of and disable the screensaver and other power schemes

I have a long-running GUI application that outputs various statuses to the user. The user wants to view every status but doesn't want to worry about the screensaver kicking in after the inactivity settings. Preferably in C#, how do I read the screensaver/power scheme settings (so I can reapply them when my app exits) and use settings a...

HttpWebRequest Won't Serialize

I'm getting the following error when I try to Serialize an HttpWebRequest Type 'System.Net.KnownHttpVerb' in Assembly 'System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' is not marked as serializable. Using .Net Framework 2.0 This is one of the properties that my class holds. It's a requirement to s...

Why are .Net programmers so afraid of exceptions?

First of all, I'm not trying to be critical of anyone here or saying that all .Net programmers are this way. But I'm definitely noticing a trend: .Net programmers seem to avoid exceptions like they're the plague. Of course, there's always the Raymond Chen blog post about how hard exceptions can be to handle. But that doesn't just app...

How do you find the users name/Identity in C#

I need to programatically find the users name using C#. Specifically, I want to get the system/network user attached to the current process. I'm writing a web application that uses windows integrated security. ...

Does an ASP.NET SQL Library Exist for Managing Tables?

Does anyone know of a SQL library in ASP.NET that can be used to manage tables? Eg SQLTable table = new SQLTable(); table.AddColumn(“First name”, varchar, 100); table.AddColumn(“Last name”, varchar, 100); if(table.ColumnExists(“Company”)) table.RemoveColumn(“Company”); The operations I am looking for are adding, editing and deleti...

Application Settings in the Database

I want to centrally locate all of my application settings in the database. I have a database object which stores the app.settings in an XML column. I'd like to have my application read that object and then parse the XML column into its own app settings. Is there any easy way to arbitrarily read an XML object into your current appsetti...

NHibernate FK is a CHAR(6), and various queries fail due to the child table PK being CHAR(6)

I have a legacy Oracle database that has multiple 1:n lookup tables that are based on CHAR(6) primary keys in the child tables. Unfortunately, I'm not the only one who has problems with how NHibernate deals with char fields (especially with those as primary keys). See: http://forum.hibernate.org/viewtopic.php?t=984281 http://forum.hibe...

Any frameworks on Authentication & Authorization for Windows Form Application?

I'm a C# developer. I develop both Windows & Web Applications. I would like to build an Winforms application that has a role-based system. All users must in role/group(s). Then we assign permissions like "View, Add, Update,.." to role/group. The role/group is dynamic, so we let users to define it. Is there any frameworks and good sample...

Individual Character Padding in XAML

Is there a way in XAML to add padding around individual characters? Preferably before and after the character. I have a textbox that I would like the input to be spaced out a bit more (so it aligns with a background image). It would be ideal to be able to do something like: Any ideas how one can accomplish this? It looks like one c...

Weird intellisense behavior with private constructor

Example: public class Name { public string FirstName { get; private set; } public string LastName { get; private set; } private Name() { } public Name(string firstName, string lastName) { FirstName = firstName; LastName = lastName; } } When trying to instantiate this c# class, intellisense sh...

Is Nant dead?

Looking at the Nant and Nantcontrib repositories at Sourceforge I noticed that the last release of Nant is from December 7th 2007 and the latest release of Nantcontrib is from October 15th 2006! So, is it looks like the development of these tools has stalled for a while. Is anyone still working on those tools? Is it smart to invest my...

Is there any good MVC/MVP frameworks or other application frameworks for .NET Winforms?

I'm not sure why finding any frameworks or good example projects for developing windows application is so difficult. I'm sure that for web application framework, we have Castle Project or ASP.NET MVC that are very great stuffs and have many examples that follow the best practices like IoC, Caching, and etc. Is there such things that ha...

Skipping a column in FileHelper

Using the FileHelper library for .Net, can I somehow skip a number of columns from the source file? According to docs and samples, I have to add fields for all columns. Alas, I have an excel sheet with 216 columns to import, from which as few as 13 are necessary. ...

Is it true that the smallest memory allocation in .net is a byte?

Is it true that the smallest amount of memory that I can allocate in managed code is a byte? Do I understand correctly that a Boolean variable takes up much more than a bit of memory? Is there a way for me to allocate memory, in .net, in chunks smaller than a byte? ...

Using jQuery in WinForms desktop app?

We have a WinForms desktop application that uses the .NET 2.0 framework WebBrowser control quite extensively for displaying HTML. The HTML may be simple, or quite complicated. It may reside on disk, or it may be written directly to the document property at runtime. I was wondering if anyone had any experience with using jQuery as a lib...

How do I create a IE Add-On in .NET?

If somebody may knows a blog posting with a basic example, that would help a lot. Google search gives me mostly links to add-in-express.com. tia ...

How to redirect WebBrowser control of another Application

I have Application, and i cann't modify it. This Application contain IEControl (WebBrowser control), which display some URLs and open some txt files. How can I get IWebBrowser2 and redirect this control to specified URL? For example i need redirect this control to http://stackoverflow.com every time control trying to open txt file? ...

Tools for testing web services

I want to perform integration testing of my webservices before shipping them out and am wondering if anyone can point out some tools for performing these tests automatically? I have both ASMX webservices as well as a few WCF ones. I want to be able to add this as a task to my build scripts and execute automatically if possible. What a...