.net

Can't fetch data do Gridview

Hi I'm trying to retrive a dataset to a Gridview, but I just don't get any row in my Gridview. What am I doing wrong? the page code Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load CType(Master, AreaTrabalho).AlteraTitulo = "Projectos" Using oSQL As New clsSQL(System.Configuration.Co...

Proper way to get a Winforms UI to block with a dialog until some non-user driven event conditioin?

I was asking about specifics with this approach earlier today here but the confused responses has me wondering if I'm going about this all wrong. So here's the problem. I need to architect a WinForms application that periodically checks a value from some external service. If it is in a certain state the application is supposed to pop ...

relative url in wcf service binding

I have a silverlight control which has a reference to a silverlight enabled wcf service. When I add a reference to the service in my silverlight control, it adds the following to my clientconfig file: <configuration> <system.serviceModel> <bindings> <basicHttpBinding> <binding name="BasicHttpBind...

Check for column name in a SqlDataReader object

How do I check to see if a column exists in a SqlDataReader object? In my data access layer, I have create a method that builds the same object for multiple stored procedures calls. One of the stored procedures has an additional column that is not used by the other stored procedures. I want to modified the method to accommodate for ev...

What API call would I use to change brightness of laptop (.NET)?

I have Windows Server 2008 installed on a Sony laptop and the brightness control doesn't work. I'd like to write a program to allow me to change it. Currently what I have to do is open the Power control panel, click advanced settings, and fight through so many UAC boxes that anybody watching me must think I'm completely crazy. I just w...

Is loading a dependency assembly from the internet a good practice?

I know there are several ways to deploy a .net windows client application: There's Windows Installer, Click Once, a simple download & run, and loading the windows forms / WCF application in Internet Explorer (no to confuse the latter with WCF/E - Silverlight RIA applications) So... thinking about the true windows client applications --...

How would you attack this polymorphism string building problem.

Sorry for not so discrptive title, if someone wants to change it go ahead. Also note I have already asked a question about this kind of thing but this one is more about how you would attack it because my attack just doesn't seem to feel right. I am having a problem with building a string up to send to an OLE object in the correct order...

Best way to implement multi-language/globalization in large .NET project

I'll soon be working on a large c# project and would like to build in multi-language support from the start. I've had a play around and can get it working using a separate resource file for each language, then use a resource manager to load up the strings. Are there any other good approaches that I could look into? ...

How do I install a .NET DLL into a COM+ application using MSI (WiX)

Update: looks like this is indeed a WiX limitation - Cannot add 64bit com+ component (3.0.3907.0) I have a .NET application with an MSI installer created using WiX 2.0. The installer creates a COM+ application (amongst other things) and installs a .NET assembly as a component into this application. This DLL is pure managed, however it c...

WPF FlowDocument Paragraph Inlines Length

Is there any limitations to the WPF Document.Paragraph object when using the FlowDocument control? I have the FlowDocument turning blank when I add a Paragraph that is more than 450 lines to the Paragraph. I could not locate anything within the MSDN documentation regarding max. lengths etc. Any ideas why this would happen? ...

ASP.NET InnerXml automatically/incorrectly appending attribute text to tags

So I have some XML in the following format: <somenode> <html xmlns="http://www.w3.org/1999/xhtml"&gt; <head> <title/> </head> <body> <p>P one</p> <p>Another p</p> </body> </html> </somenode> Nestled in there is some html, which I didn't think would be an issue...

Django Authentication from .NET using HttpWebRequest and HttpWebResponse via HTTP POST

I am creating an application in .NET that will serve as a second UI for my already-deployed Django app. For some operations users need to authenticate themselves (as Django users). I used a super-simple way to do this (without encrypting credentials for simplicity):- Step 1. I created a django view that accepted the username and passwor...

Linq validation non nullable properties

I have Linq entities which contain non-nullable string properties. I'd like to iterate over the properties, perhaps in the partial OnValidate method, and set those properties to an empty string if they are null. How can I do this without explicitly writing code for each property by name? ...

How can I disable horizontal scrolling in a WPF listbox?

This seems to be an absurdly simple question but Google and SO searches yield nothing. How can I disable horizontal scrolling in a WPF listbox when items take up more horizontal space than is available in the box? ...

Could we have custom name of the primary key column in Fluent NHibernate?

I'm so surprise while I'm working in Fluent NHibernate. I got my legacy database that has primary key column name is different from my property in domain model. I'm sure that I can use this mapping file: <class name="Person"> <id name="Id" column="CommentId"> <generator class="native"/> </id> <property name="Description" typ...

How to debug through .NET Framework source code?

I've followed the steps outlined in http://blogs.msdn.com/sburke/archive/2008/01/16/configuring-visual-studio-to-debug-net-framework-source-code.aspx to enable source debugging of the .NET Framework, and I had it working in the past. Now that I'm using .NET 3.5 SP1, it seems to have stopped working. Beyond the steps in the blog entry I...

Capturing first character on entering edit mode - custom editing control in DataGridView

I'm hosting a custom editing control in a DataGridView, which for the record is a TextBox and Button together in a UserControl. I have inherited from DataGridViewColumn for the new column and DataGridViewTextBoxCell for the new cell. With a normal DataGridViewTextBoxCell, if you press a key when the cell has focus, it will begin edit mo...

Is there a two-way dictionary in .Net?

Closed as duplicate of this question. I'm looking for a class that essentially allows me to look up values by keys but also lets me look up keys by values. Does this exist in .Net? ...

How can I use IEnumerable interface and at the same time, have XMLSerializer not use GetEnumerator()?

I have a class that parses very large file (that can't fit in memory) and I'm currently utilizing the IEnumerable interface to use foreach so I can easily grab the parsed contents of the file line by line. Currently, I'm trying to write this to file using an XMLSerializer. It insists on enumerating the class and in my case, this means ...

Dynamically add a usercontrol in VB.net

I have made a custom UserControl i Vb.net (windows application). How can I add this dynamically to a form? ...