.net

How to redirect to another page onclicking on button in gridview along with parameters

I have button in one of the columns in a gridview. On clicking on a button I need to redirect to another page along with parameters to another page. Can anybody help with this? ...

How can I hide a panel that is on a SplitContainer?

I want to hide panel2 on a split container and have panel1 utilize the space. I was hoping setting Panel2Collapsed would do the trick, but no luck. Ideas? ...

Retriggering a VB subroutine, how to serialize execution?

Sorry if this is a newbie question. I have a VB.NET subroutine that is triggered by a timer. I have found that on occasion, if the routine runs for a long time, the routine will be triggered again while it is still running with unpredictable results. Is this normal? Is each copy of the routine running in its own thread? Is there a way t...

NHibernate one-to-many mapping problem

I have to map two simple table with a foreign key relationship. One of the tables is Contact containing columns id (primary key of type int),name, address and guid (newly added and is not the primary key). The other one is phone__number containing columns id (primary key of type int), contact___id (foreign key of id in contact table) and...

App.config and F# Interactive not working

Hi, As I'm polishing my little pet project, I'm trying to store all the constant strings in my app.config file (Keys, XpathExpressions etc). When I run the compiled exe this works great. In the Interactive Shell this isn't the case. I tried to copy the .config file from my bin/Release directory to the obj/Debug & obj/Release dirs, but ...

Dynamic event handler for the ListView ?

Hello everybody, It must be my special luck that today I stack with another problem and for second time coming here for help. And I really need help on this one. I have a listView control on which i have a button control. I am trying to add event handler to this button, I googled a lot before coming to here, but examples i found either ...

How to map two tables with a foreign key relationship in NHibernate?

There are two tables, Contact and Phone__number. Phone_number contains a column contact_id which is a foreign key to id in Contact table. How do I map these two tables in Nhibernate so that I get List of PhoneNumbers in my contact class. ...

Form loads long time, how to hide the loading and display progress ?

I am using a very component heavy form that takes long time to set up. Part of the set up is behaviour of third party controls, that I cannot gather progress on. (DevExpress XtraScheduler). This freezes the app. What properties on the form do I need to set up so the forms loads in the background and what events should I contentrate on ...

What is a module in .NET?

What exatcly is a Module? What is the difference between a module, a class and a function? How can I access a Module in c#.net? UPDATE: I am asking this because- without using code signing, i want to calculate a cheksum of the IL code of only some particular functions (at runtime). ...

Form layout is not visible in visual C# for Smart Device->Windows CE 5.0->Device Application project

I am developing an application for windows CE 6.0. When i start a windows CE 5.0 device application project, IDE shows me the form in the solution explorer but there is no form layout in the designer. Instead, it appears as a control similar to openFileDialog control. The same problems does not occur if i try it on a windows applicati...

NullReferenceException in Forms.ToolStripMenuItemInternalLayout

I am receiving this weird exception through automated crash reports, and I cannot figure out what causes it: V2009.3.0.0 - System.NullReferenceException - :System.Drawing.Rectangle get_ImageRectangle():0 Version: MaxTo2009.3.0.0 Exception: System.NullReferenceException Error message: Object reference not set to an instance of an object....

How do I instantiate a type and its value from a string?

I have code similar to this: class Foo { Dictionary<Type, Object> _dict; void Create(string myType, string myValue) { var instance = Type.Instanciate(myType) // How do I do this? if (var.IsPrimitive) { var.GetType().Parse(myValue) // I know this is there...how to invoke? Dictionary[instance.GetT...

.NET WinForm GC question

Is this code clean? private void button1_Click(object sender, EventArgs e) { frmCustomDialog f = new frmCustomDialog(); if(f.ShowDialog() == DialogResult.OK) TextBox1.Text = f.MyCustomProperty; } Do you need to close or dispose the form f or anything? Or is it automatically garbage-collected? Thank you. ...

What is the best practice for readonly lists in NHibernate

Hello, Domain Model I am working on has root aggregate and child entities. Something like the following code: class Order { IList<OrderLine> Lines {get;set;} } class OrderLine { } Now I want my Order to control lines. Something like that: class Order { OrderLine[] Lines {get;} void AddLine(OrderLine line); } At this tim...

Where can I report .Net Framework bug ?

What's the best way to get a bug in a .Net Framework resolved? ...

I have to make a delegate such that when my statusbar gets updated then an event is triggered and the respective text gets displayed.

I have a project in which status bar gets updated many a times. Now i want to create a delegate such that whenever my status bar gets updated then an event is triggered inside the main form class and respective text gets displayed in the status bar, so that i dont have to create a different StatusLabel.Text for everytime my status bar ge...

Entity framework in a layered architecture?

Doing some experiments around WCF and Entity Framework. A couple of questions. Option 1: I understand that entity framework classes can be serialized over WCF directly, with sp1 onwards. How ever, I would like to know how scenarios like delay loading, eager loading, context management etc is handled in this, if they are handled at all?...

NSIS: Find and download .Net Version

How can I get the version of .NET with NSIS? And if I don't have the necessary version, it redirects me to a site to download it. I've found some solutions to this, but they usually have some hard coded stuff (e.g. dozens of specific links). Is there some good solution for this? Thank you note: I dont want to use windows installer/c...

CMS for a personal website - ASP.NET/C#

I plan to create a community website aimed at publishing ASP.NET articles, blogs, forums and video tutorials. I am considering DNN and MojoPortal. Some of my requirements are: An editor that lets me post code with ease Open source preferably written in C# Easy to export content if there is a need to switch CMS Some way of easily posti...

Catch tasks from windows task scheduler in a .net app

I have a program that is running in the background, this program has to be notified when a specific windows event is occurring. I know the name and id for the event and i know how to schedule an action for it in the task scheduler, but here i can only start a new program. I want to call a function in an already running application. Edi...