.net

Form top most?

How can I display something over all other application. I want to to display something over all form of my program and all other programs open on my desktop (not mine). *Top Most doesn't work I have tested and my browser can go OVER my application :S Here is an image of when I use TopMost to TRUE. You can see my browser is over it... ...

How to check if a Active Directory server is up and running using .Net?

Before trying to query the AD server I would like to check if it is alive and kicking. Looks like a trivial thing, but I haven´t found anything to elucidate this. How can I do that? ...

.NET: How to look up a user in Active Directory?

How do you look up a user in Active Directory? Some example usernames are: avatopia\ian avatar\ian [email protected] [email protected] avatopia.com\ian It's important to note that i don't know the name of the domain, and i shouldn't be hard-coding it. There is some sample code on stack-overflow that fails. using System.DirectoryS...

Safe stream update of file

We perform updates of large text files by writing new records to a temp file, then replacing the old file with the temp file. A heavily abbreviated version: var tpath = Path.GetTempFileName(); try { using (var sf = new StreamReader(sourcepath)) using (var tf = new StreamWriter(tpath)) { string line; while ((l...

What means digits in Stack Trace

Exact duplicate of this question. When You get an error in .Net application we got an a Stack Trace. For example [ADOException: cannot open connection] NHibernate.Impl.SessionFactoryImpl.OpenConnection() +153 NHibernate.AdoNet.ConnectionManager.GetConnection() +119 NHibernate.Impl.SessionImpl.get_Connection() +42 What do...

Crystal Reports: Passing Multiline Parameter Values

Hi, I want to pass some parameters to a Crystal Report like this: ReportDocument.DataDefinition.FormulaFields[parameterName].Text = 'Text'; This workes fine unless I want to pass a multiline textbox from ASPX (containing \n and \r chars.) The reportviewer reports that "The matching ' for this string is missing.". Is there any ex...

Good Source Of .Net Design Patterns

I'm looking for a good online resource of software patterns. Preferably something with a comprehensive selection and concise well written explanations, not just a collection of links. .Net examples would be nice, but not essential. ...

Passing a List from Silverlight using WCF

Hi there, I have my WCF service defined as follows [ServiceContract] public interface IService1 { [OperationContract] IList GetMyTable(); [OperationContract] void SendMyTable(List<RatePositions> ratePositions); [OperationContract] void SendString(string value); } When I call GetMyTable() fro...

How to fill DataTable from an in-memory Excel Worksheet

Our client gets Excel files in Excel's HTML format.(That's the way it arrives; nobody has any control over that.) We then need to run a report based on the data in the file. Using ADO.NET (OleDbReader) results in a "External file not in expected format" exception. If the data is converted to regular Excel format it gets read in OK. Howe...

Should I choose to learn Java or .NET?

Possible Duplicates: Should I learn C# or Java? Should freshers learn Java or C++? I have an option of selecting Java or .NET as my language. Which one is the best to choose? In which can I see a brighter future? ...

There actually is COBOL in .NET?

I was checking Microsoft's Visual Studio page just now and in the advertisements sidebar I suddenly saw an incredible advertisement: "Net Express is a COBOL development environment for extending core business processes to the .NET Framework and other distributed platforms." Of course I followed the link and found a company that do...

How to correctly draw a listbox and image in .net?

protected override void OnPaint(PaintEventArgs e) { e.Graphics.DrawImage(render, 400, 400); } This is the OnPaint of the Form1 class. The form has a listbox. The problem is with the render only showing partially when doing a resize on the form. Is the listbox somehow clipping it out? The listbox and the bitmap don't overlap. I've ...

How to make each Treeview Node have a related TextBox

Hi, I am trying to make a form in which the user fills in values. It is quite long. I wish to use an expandable tree to fit it into my one form. Is there any way to give each TreeView Node a TextBox by its side? Having the node text edited by itself is not enough. ...

Castle/ Active Records: How do you count objects?

Hi, I'm trying to do a simple "Select Count(*) from PRODUCTS where date > xxx" with Castle on NHibernate. If I was directly using NHibernate, I could reuse this question answers but unfortunately I see no easy way to access the Current NHibernate session from Castle Records. I obviously don't want to retrieve all my objects and do a C...

Reading Unicode with Console.ReadKey

Is it possible to provide Unicode input to a console app, and read the Unicode char/string via Console.ReadKey()? I know Unicode works when reading the input via other methods, but unfortunately I need to use the 'interception' feature provided by ReadKey. Update: When pasting a Unicode character such as U+03BB (λ) into the console, 3...

I need help: .NET Sample code to read file file properties like title and summary

I need help: .NET Sample code to read file file properties like title and summary in .NET ...

How to use Windows Key in my Application

Like: Windows Key + E Opens a new Explorer Window And: Windows Key + R Displays the Run command How can I use the Windows Key in a KeyDown event of my Application? ...

How to get keypressed, keydown events from DataGridView data cells

Hi. I need to receive the key press events during cell editing in DataGridView control. From what I have found on the net the DataGridView is designed to pass all key events from DataGridView to the cell editing control and you cannot get these events easily. I found this piece of code that traps those events for DataGrid control, but...

Selectively remove from where clause in LINQ expression tree

Starting with the following LINQ query: from a in things where a.Id == b.Id && a.Name == b.Name && a.Value1 == b.Value1 && a.Value2 == b.Value2 && a.Value3 == b.Value3 select a; How can I remove (at runtime) one or more of the conditions in the where clause in order to obtain queries similar to the following ones: from a ...

How do I take a GUID as an attribute parameter?

I need a Guid property in some attribute class like this: public class SomeAttribute : Attribute { private Guid foreignIdentificator; public Guid ForeignIdentificator { get { return this.foreignIdentificator; } set { this.foreignIdentificator = value; } } } But in attribute definition I can use only primiti...