.net

Dynamically disable/enable checkboxlist items

i have a CheckBoxList with a list of services that the user can execute... some of this services can't be executed with some of the others, some services can only be executed alone etc.. All this rules are stored in my database. Is there anyway for me to disable/enable (make unclikable) checkboxlist items that can't be executed togethe...

Programmatically submitting a Microsoft AJAX form

I'm using ASP.NET MVC and Microsoft AJAX to create an AJAX form using this following syntax: using (Ajax.BeginForm()) { ... } This works fine if the user clicks a submit button. However, I also need to programmatically submit the form. The problem is, the way MS AJAX works (for reasons that escape me) is that it puts the submit acti...

Can sn.exe utilize the Windows certificate store?

For signing an assembly with sn.exe in .NET, is it possible to specify a public key for which the private key is contained only within the Windows CryptoAPI keystore? I see the option for specifying the CSP name, and the container name. Are there values to use to access the Windows certificates? (i.e. those accessible from Windows EFS,...

Outlook View Control

I'm wanting to embed a user's outlook calender using the Outlook View Control; however, I'm having problems just displaying the calendar for that current day (not the whole week/month). Here's my current code <object classid="CLSID:0006F063-0000-0000-C000-000000000046" id="ViewCtlFolder"> <param name="Namespace" value="MAPI"> <...

Displaying a decimal value on a windows form

I need help with displaying a decimal value on a Windows Form. I have a class with a method to calculate an interest amount, listed below. public virtual decimal CalculateInterest() { interest = (interestRate/100) * base.getBalance(); return interest; } In my main form, I am using this method when a button is clicked, listed ...

ASP.NET MVC & SQL Server Reporting Services

I am getting started with ASP.NET MVC. Is it easy or even possible to use the ReportViewer in MVC as you can with webforms? If not, what can be done? ...

How important is the usage of string resources? When is it appropriate/inappropriate to use/not use them?

My work has a policy (in a different department) that reads roughly as follows: When applicable, store strings in String resources. If dynamic strings are needed use indexed place holders. Don't do this: string myString = String.Format("Name = {0}, hours = {1:hh}", myName, DateTime.Now); But do this: string myString = String.Format...

Linq to Sql, derived to derived association

I dont know if its possibe. I have a base table with 2 derived tables. Mammal Mammal -> Boy Mammal -> Dog A want that Dog table has a foreign key(ownerBoyId) to Boy table, but linq designer dont permit, because Boy itself dont have a Id collumn, Id is inherited. How can I resolve this problem? Associate to Base class? ...

Can a aspx page be loaded into a Silverlight Control?

Forgeive me if this is a dumb question, im very new to SL, just ordered 3 books which i should have tomorrow - but i cant stop thinking of the 'is it possible' stuff. Heres what i would LOVE to do, dont know if it possible: Have a SL control on a page that loads a passed in url or aspx (like the browser control for winforms) - the reas...

How to compile using VS2008 so binary doesn't require .NET?

I'm trying to compile a very simple C application using VS2008. My problem is that the resultant binary requires systems to have .NET installed. No actual code within the project uses .NET functionality, but I get errors during execution on any system that doesn't have .NET. So, is there anyway to compile using VS2008 so the resultant ...

How do you properly use a static property that implements IDisposable?

As an example: using (Brushes.Black) { ... } is not a good idea, because it is static. The next time your app goes to use Brushes.Black, you'll have problems, because it has been disposed. Now, if you're only using Brushes.Black, then it's probably ok to not dispose it, because you're only leaving one unmanaged resource (hopefully!) ...

Oracle OCIEnvNlsCreate error when connecting from Windows service

As noted by the question's title, I'm trying to connect to an Oracle database from a Windows service and I am getting the following error message: System.Exception: OCIEnvNlsCreate failed with return code -1 but error message text was not available. Other applications on the same computer are connecting to Oracle without any issue...

Join two data tables from different source databases in .NET?

How do you join two data tables from different source databases in .NET? Ideally, I can craft two queries manually and simply join on a single field. In this case, linked servers and scheduled imports are not an option. I've looked into the data relation object, but (correct me if I'm wrong) that only works for parent-child relationshi...

How does one achieve .NET Deployment Nirvana?

Our company is nearing its "go live" date (and its getting a QA department date), and I'm trying to define the right operational processes to support this. A big consideration of mine is how to avoid the deployment/configuration hell that has inevitably occurred. Have any of you found a good solution for handing off builds to the non-p...

How would you design an application to run a machine?

What type of machine you ask? A machine that measures wedge and roundness of lenses. I've already written software for the machine and it is in production, but it is brittle and prone to lock ups when they dont do things in the right order. I'm trying to come up with the best way to architect it so that its stable and maintainable. Her...

Can someone provide (a link to) a useful InheritanceDemand example?

I have the following class: [UIPermission(SecurityAction.InheritanceDemand, Window = UIPermissionWindow.AllWindows)] public class PrintData { protected string Data = "secret value"; public virtual void PrintString() { Console.WriteLine(Data); } } Can someone provide an example i...

Getting the original files create date upon upload.

We have a process in place that uploads files to our website. It has become important to the users to be able to see when those files were created. I'm looking for a way to extract the original create date from the HttpPostedFile. If anyone has an idea for me I'd really appreciate it (I'm a bit stumped at this point). ...

How to get the name of a property of type myClass?

I have a custom class (call i Field) that that implements several properties. One of the properties is MaximumLength that spcifies the maximum length that the value can be. The Value property is an object so i can be set to string, int, double, etc. Then I have a class that has multiple properties of type Field in it. All the Field prope...

How can multiple audio files be played in sequence?

In my C# application, I need to play multiple audio files (WAV and MP3) one after the other. How can I accomplish that? ...

Is it possible to Shut down a local pc with group policies programatically through .net application?

I have a local application running with an user than have a group policy indicating this user can’t shutdown the pc. And then I use your code, but when I ask by user and password to impersonate my app. I received the next error System.Management.ManagementException: it’s not possible to use the user’s credentials for the local connecti...