I have a security descriptor for an object. I want to get users and groups having permission on that object using that security descriptor. How to know which users are having what permissions using that security descriptor? Is it possible using ObjectSecurity or CommonObjectSecurity abstract classes? If so how to define access rules? Is ...
How can I increase the width of a DropDownList in ASP.NET?
...
I'm not getting the behaviour I would expect for a TextBox bound to an integer property in a business object.
Here's what I did:
(1) Set the DataSourceUpdateMode, for the TextBox to: OnValidation.
(2) In the Validating event for the TextBox, set e.Cancel = True if Integer.TryParse fails.
(3) Add a handler to Binding.Parse and Binding...
I've caused myself a bit of an issue with my Data Access Layer. In this particular instance, I have a table that contains potentially 5 types of 'entity'. These are basically Company, Customer, Site, etc. The type is dictated by a PositionTypeId within the table. They're all in the same table as they all havethe same data structure; Posi...
I have an XmlReader that is trying to read text into a list of elements. I am having trouble getting it to reader the text: "a [ z ]". If I try with the text "a [ z ] " (same but with two trailing spaces) it works fine. Below is an example:
TextReader tr = new StringReader("a [ z ]");
XmlReaderSettings settings = new XmlReaderSettings
...
As I mentioned here, I'm trying to generate HTML from an ASPX page inside a WinForms.
I'm trying to compile the ASPX page directly into the EXE; I'd like to be able to write something like this:
var page = new ASP.MyPageName();
var stringWriter = new StringWriter();
using(var htmlWriter = new HtmlTextWriter(stringWriter))
page.Rend...
I'd like to add a value to a struct
if (!existISDNteilnehmer(split))
{
isdnObjs.Add(new ISDN() { name = split, number = "",
channels = new List<string>()});
}
ISDN? actualISDN = getISDN(split);
if (index < ISDN_teilnehmer.Count())
{
var numbers =
from num in xISDN.XPathSelect...
I have an excel file that have the list of contacts( about 10 k of them) that I need to push into my SQL Server database. So, I am writing an .net windows program using visual studio 2008 to read the files, generate random password for each contact, and then push these information in to my SQL Server database.
It was easy to handle excel...
I have a number of controls with ToolStrips containing buttons. I need to show or hide some of the buttons when the mouse enters the toolstrip. I know Mystery Meat is bad but it's what I've got to do.
The ToolStrip's MouseEnter event fires when the mouse enters, but MouseLeave does not always fire when the mouse leaves. I think this ma...
How can I minimize the footprint of a website built using MVC. My application currently runs at around 20mb, I'd like to reduce it if possible.
Edit: I've switched hosts, problem solved.
...
I recently upgraded to Windows 7 from Vista and since switching, I can no longer use nunit-gui.exe to run my tests. Every time I do, I get the following error:
System.IO.FileLoadException: Could not load life or assembly 'nunit.framework. Version=2.4.1.0 Culture=neutral, PublicKeyToken=96d09a1eb7f44a77' or one of its dependencies. The ...
Founded that:
typeof(System.Enum).IsClass == false
It's become strange that System.Enum has also .IsValueType == false, but Reflector shows that it is really just an abstract class.
System.Enum is a reference type like a System.ValueType and casting enumeration values to/from System.Enum reference caused boxing/unboxing. No surprises...
Hi,
I have a text file with multiple lines. I'll try to set a pattern to add a new carriage return in some lines of the text. This lines are like that:
lorem ipsum.
dolor sit amet, consectetur adipiscing elit [FIS] Donec feugiat
Well, the pattern is a line followed by other which has some characters and a '[' character too. If '[' is ...
What's the best way to print a BitmapImage? I come from a background in System.Drawing so I was thinking about converting it to a Bitmap and then printing it, but I'm thinking there's probably a better way.
Thanks!
...
How to draw triangle wave (symmetrical) using ZedGraph?
Preferably with option to adjust period and amplitude.
//Edit: the function has to be [related/based on]? x (x-axis).
Something like this:
for (x = 0; x <= 10; x += .005)
{
if (Math.Sin(x * (2 * Math.PI / period)) >= 0)
y = amplitude;
else
y = -amplitude;
...
I mean library and syntax of C#.
...
I have a .Net DLL that I created that implements a WCF client that talks to a WCF service, allowing the end-user to pipe data to the server where the service resides.
I use this DLL in client programs I developed for work, but now I wish to use this .Net DLL in a web page so the client can be delivered to an end-user on the net.
ASP.Ne...
If I have an enum that's marked with [Flags], is there a way in .NET to test a value of this type to see if it only contains a single value? I can get the result I want using bit-counting, but I'd rather use built-in functions if possible.
When looping through the enum values dynamically, Enum.GetValues() returns the combination flags a...
I have a web page with a GridView. The GridView contains a list of Question objects. Each Question has a QuestionType. When the user clicks on the Question control, an Ajax modal popup appears containing a Dialog custom web control. The Dialog web control is designed to encapsulate a child custom web control together with OK and Canc...
Is there a way to convert an int to a bitmask?
example:
int i = 33;
should be converted to (not sure of the datatype)
bool[] bitmask = new[] {true, false, false, false, false, true};
Update
In reaction to most answers:
I need to do this:
BitArray bits = new BitArray(BitConverter.GetBytes(showGroup.HasValue));
List<String> showSt...