.net

Application demands elevated privs to run on win7 but not vista

I have a simple app that I just tried the installer (Innosetup) on win7(32-bit). After I install it the program icon on the desktop gets that shield on it that notifies the user that the app demands elevated privileges. I thought it was something wrong with the installer and made on using NSIS instead, same problem. Does anyone know wh...

How to pass a table from frontend to a stored procedure?

I want to pass a table as a parameter to a stored procedure. Is it possible to do it. Please give some example. ...

Asp.Net: Storing Principal in httpcontext.current.items

Hello, I was wondering if there are any downsides of storing a custom Principal in httpcontext.current.items instead of the httpcontext.current.user. I know you need to set it for each request but I have to do that with httpcontext.current.user also. thanks in advance, Pickels ...

finding a point on an ellipse circumference which is inside a rectangle having center point, height and width?

Hi all. I have a rectangle in .NET in which I draw an ellipse. I know the width, height and center point of that rectangle. Of course the center point of the rectangle is also the center point of the ellipse. I know how to calculate a point on a circle, however I have no clue about an ellipse. I have those parameters and an angle, i...

Missing Status Bar in Visual Studio?

Note: This question and answer is a full copy from Kelly Brownsbergers Blog. I do post it as a convenience to others. From time to time, my status bar disappears. I used to believe this was due to a botched install or add-in. I recently upgraded to Team System Test Edition, and my status bar again disappeared. For the last few weeks ...

Implementing search functionality with multiple optional parameters against database table.

Hello, I would like to check if there is a preferred design pattern for implementing search functionality with multiple optional parameters against database table where the access to the database should be only via stored procedures. The targeted platform is .Net with SQL 2005, 2008 backend, but I think this is pretty generic problem. ...

Can i use live meeting service portal API with SharePoint?

Can I use live meeting service portal API with Sharepoint to schedule live meetings and OCS meetings from a sharepoint page? If yes, what should be the starting point and which approach is better. Can i use VSTO for that or not? ...

Saving Data in a SilverLight Webpage

Hi, im trying to perform a simple database insert from a submission on a SilverLight Webpage. Normally i would either use ADO or LINQ to SQL to perform this. You can not do this within a SilverLight Project, nor can you reference a project that can (a non SilverLight project). What would be the best way of doing this? Thanks. ...

Why can event handlers can only be bound to HttpApplication events during IHttpModule initialization?

This is just another "working in dev server, why not working in IIS" type question. I created a nice DAL using NHibernate as described here. When creating an ISession, I hook up an event handler to the HttpApplication.EndRequest to take care of cleaning it up. However, I deployed my site to IIS and it says: Event handlers can only be ...

OnPaint event during a callback when the form is below?

Imagine the following scenario: this.SetStyle(ControlStyles.UserPaint, true); //this doesn’t change anything … void OpenSomeForm() { SomeForm sf = new SomeForm(); sf.SomeEvent += new … (SomeEventOcurred); sf.ShowDialog(); } private void SomeEventOcurred(…) { OnePanelInThisForm.Invalidate(); } private void OnePanelInT...

Load from resources, or draw them myself

Hi All I was just wondering, is there any benefit in me drawing my own buttons (just rectangles) over loading 80 of them from resources? Thanks ...

How do i configure optional flags in MVC 1.0 routes

I want to configure a route with optional flags. E.g. I want to be able to call the products page and send optional filters (flags) for offers and in stock options. If the flags are NOT specified then all products should be returned. http://localhost/products http://localhost/products/onlyOnOffer http://localhost/products/onlyInStock...

.net URL Rewriting with IIS ignoring a specific url

I have a site which recently went live. At present all requests for the staging site are caught by the rewrite rules and 301d to the live site, however I now need to allow the homepage only to bit hit, with all other requests redirecting as before to their equivalent page on live. The first part was straightforward enough: <rule name=...

Linq to XML lessons learnt

Hi guys I'm just starting a project which requires some pretty hardcore linq to xml to be used and I am just wondering what people consider best practice and lessons learnt. For instance, I am worried about all the nulls that are possible all over the place... This is something that I am using but how do other people deal with it: ...

How to do Custom Validation on Multiple Properties in ASP.NET MVC 2.0?

Basically, what the title says. I have several properties that combine together to really make one logical answer, and i would like to run a server-side validation code (that i write) which take these multiple fields into account and hook up to only one validation output/error message that users see on the webpage. I looked at scott gut...

SQLCLR using the wrong version of the .NET Framework

During a recent restart of our development server the SQL Server started using .NET 4.0 for the SQLCLR. This means that nothing using the CLR in SQL works, or at least that's my understanding by reading these sources: http://software.intel.com/en-us/blogs/2009/10/16/sql-server-2008-sqlclr-net-framework-version/ www.sqlskills.com/BLOGS/...

What is the difference between a DataSource and DataAdapter?

Title says it all. What is the difference between a DataSource and DataAdapter? I'm trying to decide if I should descend from IDataSource or IDataAdapter for code to be shared between Winforms and WebForms and I can't seem to figure out what the difference is other than slightly different ways to use them. ...

programmatically get BPM of a wave or MP3 from .Net

I have a project with a requirement to get the BPM of a wave or MP3 file programmatically using .Net (VB.Net or C#). Does anyone know of a binary or library for this or have a code snippet to steer me in the right direction? ...

Changing the values of a class returned by the array [] operator

The question is: at the end of this code the value of ptArray[0].X is 3.33 or 1.11? Thanks. class MyPoint { public double X, Y; public MyPoint(double x, double y) { X = x; Y = y; } } MyPoint[] ptArray = new MyPoint[2]; ptArray[0] = new MyPoint(1.11, 2.22); MyPoint first = ptArray[0]; // Am I changing ptArray[0] ...

Match Regex across newlines?

I have a regex ( "(&lt;lof&lt;).*?(&gt;&gt;)" ) that works and matches perfectly on single line input. However, if the input contains newlines between the two () parts it does not match at all. What's the best way to ignore any newlines at all in that case? ...