.net

SQL Algorithm Trouble - for loop to add and filter results

I am struggling yet again with SQL with my search function. Basically I want a stored proc that splits up a string into words then for each word I want to check using Full Text Search if it is in any of 2 tables. If results are found in these tables it should add them to any results it found for the other words and return a set where t...

GDI+ Image Conversion From Metafile to JPEG/GIF Results in Black Background

So i am converting a metafile (EMF to be exact) to a jpeg or gif (doesn't matter as long as it's compatible with browsers) and when I do the conversion, all of the transparent pixels turn black. I have no idea how to do this in GDI+ but here is the method I am using to save the file: Dim Img As System.Drawing.Imaging.Metafile = New Sys...

What does this .NET attribute do?

[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] I saw this attribute in the reflector for the base class libraries in .NET. Maybe immutable guarantees are supported internally? ...

.Net and sql server Search

I have an asp.net web application written in C# using a SQL Server 2008 database. The database contains events with information across a number of tables such as event, venue, city and bands playing. In the ideal world I'd like my users to enter a natural lanaguage type query in a single search box along the lines of "The Who in Brisban...

Caching when using Query Expressions?

I was reading an article about how query expressions defer executions. Does that mean when we have a collection like: IEnumerable<int> collection = from i in integers where i % 2 == 0 select i; It is gonna be recalculated every time the collection is accessed? If so, what's the general practice to deal with this? To convert into a ne...

Code demonstrating the importance of a Constrained Execution Region

Could anyone create a short sample that breaks, unless the [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] is applied? I just ran through this sample on MSDN and am unable to get it to break, even if I comment out the ReliabilityContract attribute. Finally seems to always get called. ...

WPF Content alignment problem

Here is the code that cause me problem since few hours: TabItem newTab = new TabItem(); newTab.Header = source.Name; newTab.Content = source.GetGui(); newTab.HorizontalContentAlignment = HorizontalAlignment.Stretch; newTab.VerticalContentAlignment = VerticalAlignment.Stretch; this.inputSou...

Are there any .NET Graphics Calculate Libraries?

Sorry for my bad English. I want to find a Calculate Library not a Drawing Library to help me do some graphics calulation like Bezier's length, point on Beziers or other metadata. Is there any library like this? ...

Help with Tic Tac Toe game in Visual Basic 2005

I'm having 2 problems with my game. 1.) Upon initialization, if I select multiplayer, the buttons are still disabled. I have to refresh to get it to work. 2.) When I'm doing single player, my AI is not working right. When the AI picks its square, it still lets me choose a square with the AI's symbol as if I'm playing a multiplayer gam...

How do I migrate a VB6 ActiveX control to VB.net?

I have a legacy VB6 ActiveX control used in IE to provide control of a parallel-port device from a browser application. I wrote this thing about five years ago; It's a pretty simple control, and it doesn't require a lot of maintenance. However, I've noticed that running the VB6 tools is becoming more and more painful over time, so I'm ...

VS 2010 Beta 1 doesn't recognize the System.Printing.PrintTicket class

I'm having the following problem using the Visual Studio 2010 Team System Beta 1: While working on some printing code, I tried to declare a variable of type System.Printing.PrintTicket, but Visual Studio doesn't seem to recognize that the class exists. It appears in the MSDN documentation, and other classes like System.Printing.PrintQue...

Get UPN or email for logged in user in a .NET web application

I'm not a .NET developer, and I have a feeling this would be trivial for someone who is: I have a C# web application that makes user of the user credentials of the logged in user. Currently it uses the SID which comes from System.Security.Principal.WindowsIdentity.GetCurrent().User.Value I need to get either the users UPN login or e...

MVC Views can't reference assembilies

Hi there, Is there a reason why i can't reference any assemblies from my master page or views? So for example in my controler classes I can go MyRootnamespace.OtherAssembly.ClassName but when I do this in my view like: <% MyRootnamespace.OtherAssembly.ClassName %> it says OtherAssembly does not belong to MyRootnamespace ...

List of Log4net Conversion Patterns

is there any comprehensive list of all the conversion patters available for log4net, I can't even find them in the source code. all i have found is this, shouldn't there be more patterns. for example how would i get the name of the hosting application? another question is how can i add my own patters? just as an example here is the co...

WPF ListView Virtualization Grouping

Does anyone know of a ListView implementation that support UI Virtualization when grouping is enabled? By default the VirtualizingStackPanel is disabled when grouping is setup. It seems that Microsoft is not going to implement this within v4.0 of the .NET Framework so I am look for alternate solutions. ...

how to make DataSet return two related Tables?

Hello everyone, I am using C# + .Net 3.5 + VSTS 2008 + ADO.Net + SQL Server 2008. I have two related tables in SQL Server (foreign key relationship). And I want to load the two tables as two datatables in a dataset. Any reference code to do this? thanks in advance, George ...

How to deal with unstable 3rd party object tree (sorry, I can’t come up with a better title)?

Let’s say I have to use an unstable assembly that I cannot refractor. My code is supposed to be the client of a CustomerCollection that is (surprise) a collection of Customer instances. Each customer instance has further properties like a collection of Order instances. I hope you get the idea. Since the assembly behaves not that well my...

Different startup forms for different developers using SVN in VB.NET?

My scenario is such that I have a VB.NET project in SVN and I am using the Application Framework to start the application. This poses a great problem when different developers are working on different forms and they want to have different startup forms. Right now if we change the project settings, its changed for everyone else too. How...

How do I add a reference to the MySQL connector for .NET?

what dows this mean: Next add reference to: MySql.Data actually i have downloaded mysql connector/net. by following these instructions: First, you need to install the mysql connector/net, it is located at: http://dev.mysql.com/downloads/connector/net/1.0.html Next create a new project Next add reference to: MySql.Data Next add "us...

How to provide custom string placeholder for string format

Hi, I have a string string str ="Enter {0} patient name"; So I am using using string.format to format that. String.Format(str, "Hello"); Now if i want patient also to be retireved from some config then i need to change str something like "Enter {0} {1} name". So it will replace the {1} with second value. the problem for me is that...