.net

Setting Up Model Approach in Entity Framework 4

Hello, I am beginning a new project, so one of the tasks given to us is to determine whether we should create one large Entity Framework 4 model (don't know how many tables yet), or split the model into separate models, one per module within the application. If we create separate models, we'll have repeated entities within each module,...

How to remove unclosed <P> tags from xhtml

Possible Duplicate: Removing unclosed opening <p>tags from xhtml document I have a big xhtml Document consisting of lots of tags. I have observed that a few unclosed opening paragraph tags are repeating unnecessarily and I want to remove or replace them with blank space. I just want the code to identify unclosed paragraph ta...

Configuration Error With Custom Behaviour

I've created a custom behaviour for use with a WCF service to log all errors to the application log. I have made a BehaviorExtensionElement for the behaviour: public ErrorLoggingBehaviorExtensionElement : BehaviorExtensionElement { public ErrorLoggingBehaviorExtensionElement() { } /* - Elements removed for brevity - */ } I a...

Using pen strokes with fuzzy tolerance algorithm as encryption key

How can I encrypt/decrypt with fuzzy tolerance? I want to be able to use a Stroke on an InkCanvas as key for my encryption but when decrypting again the user should not have to draw the exact same symbol, only similar. Can this be done in .NET C#? --- Update (9 sep) --- What I ideally want is an encryption algorithm that would accept ...

Need to know whether a device is wired serial or Bluetooth

I need to find out programatically whether a connection is a Bluetooth connection rather than a physically wired connection to a comm port. This is on Windows using .NET. ...

Selecting rows with distinct column values using LINQ

I have a generic list of SharePoint list items (List employees) The SharePoint list contains the two columns, "Employee Name" and "Employee Designation" I want to get an object List which contains distinct "Employee Designation" column values. How do I do this using LINQ? This didnt work for me: var designations = from SPListItem e...

Connection between 2 computers via dial up modem without internet in c#.

Hi Is there any way to connecting to computers via Dial Modem without internet? Like windows Hyper terminal. making connection sending files between computers. Just Connection Between two Computers Directly and sending FIle. ...

Is there a method to determine if a file path is nested within a directory path in .Net

I want to determine if a folder contains a file, when both are specified by a path. At first glance this seems simple. Just check if the file path starts with the directory path. However, this naive check ignores several issues: Paths may be relative or absolute Paths may use the alternate directory separator Paths may use inconsisten...

getting client computer name in a flex web application?

is it possible to obtain the computer name of the client using flex? I made a small intranet application and I need to log computer access to it. I used Flex 3.4 and web services in .net 3.5 thanks. ...

What is Cross-Platform Development ?

.NET is for Windows ! But, though for linux environment, MONO achieves goal for .NET support. What is Mono ? Is it linux IDE for dotnet support ? How many languages are supported by .NET ? Mono uses cross-platform development concept. What does it mean by ? ...

What happens between TestMethods in MS Visual Studio Unit Tests

The title says it - What happens between TestMethods in MS Visual Studio Unit Tests? I have a bunch of TestMethods in a TestClass that has a TestInitialize method. The TestInitialize method internally loads a Type via Reflection (eg. Type.GetType("MyContainer, MyContainerAssembly") ). MyContainer is a class that inherits from WindsorCo...

Retrieve picture from an url

Hello, On my ASP.Net page in C#, the user is able to enter an url (web page). When it's done, I would want to get the picture in this page. For an example of this, go on Facebook and write a status with an url in it. A panel open with the description of the page AND the picture. Is there a parser or a little application that I can use ...

How do I chain Asynchronous Operations with the Task Parallel library in .NET 4?

I'm attempting to programmatically chain asynchronous operations in C#4, such as Writes to a given Stream object. I originally did this "manually", hooking callbacks from one operation to the next, but I thought I'd try the .NET 4 Task Parallel Library to save myself the trouble of re-inventing the concurrent wheel. To start with, I wra...

Set DataServiceHost DataService Context

Is there a way to set the context for your DataService in WCF Data Services? For example, say I have the following DataService: public class MyDataService : DataService<MyContext> Let's say MyContext has an interface of IMyContext and I obtain an instance of this during a custom DataServiceHostFactory's constructor by using Unity. So,...

Sql Server Reporting Services vs Reporting Via .NET Application

My boss wants me to create a few reports in the near future and I think he wants to use SQL Server Reporting Services to deploy the reports. I'm not so sure this would be such a great idea considering that we are a pretty small organization and I cannot see us making good use of or needing the features that this solution offers such as s...

PostBackUrl in RadPanelBar Telerik

Greetings everyone.. i would just like to ask.. how do i assign a postback url in my radpanel items in my master page Eventually i have a MasterPage wherein i construct my radpanelbar.. and i have this Item Quiz with a child name Create What i want to achieve is when i hit the button Create in my radpanelbar it will make a PostBackU...

Any .net Code Coverage Plugin for Visual Studio 2010?

Can anyone please suggest me a good .net code coverage plugin for Visual Studio 2010 except dotCover? [dotCover 1.0 RC is buggy, it hangs VS 2010] The VS2010's own coverage tool does not support nUnit tests. I want a plugin which supports nUnit tests also. ...

Can .NET VM (mscorlib) be called from native Win32 program to execute IL/other internal compiled code format?

Old question: I have an .exe (PE) with IL (.NET) code in it. When it is started, a mscorlib.dll (.NET framework) function is called to start IL code. Can I extract .NET code segment and append it to other program (that calls mscorlib.dll to execute that segment)? New question: I want to append the compiled code from a C# .NET program...

How can I get rid of unwanted attributes in serialized XML?

I am serializing objects to XML with the following code: public static string SerializeToString<T>(T objectToBeSerialized, string defaultNamespace) { StringBuilder stringBuilder = new StringBuilder(); XmlWriterSettings xmlSettings = new XmlWriterSettings() { CloseOutput = true, Ind...

ObjectContext.SaveChanges() violates primary key, throws UpdateException?

Paraphrasing from this MSDN documentation ... An INSERT statement is generated by the Entity Framework and executed on the data source when SaveChanges is called on the ObjectContext. If the INSERT operation succeeds, server-generated values are written back to the ObjectStateEntry. When AcceptChanges is called auto...