.net

DataContext's Connection string help

I have the following connection string: "Data Source=localhost\\SQLEXPRESS;", it complains that '' is an invalid username. I can't quite remember the user name or password commands, nor can i remember if there's anything else i'm missing. Can someone help? ...

How do I implement an auto update strategy for my in-house winform app

We have an in house winform application that is used by about 20 users in my company. It's a real pain having to send the users a new msi when the application has changed in scope and I would like to have the users prompted from the application as to whether they would like to update their copy. My thoughts are that the source of the app...

Add data to a Table<T>?

I have a property on a class that happens to be a Table. How do i add an item to this? ...

How do I view the errors that occured in a skelta workflow?

I have a skelta workflow that has "finished with errors" according to the WorkflowExecutionReport. Unfortunately I can't see any way to actually see what the errors were so I can figure out what went wrong. Does any one know how one goes about viewing these errors? ...

Maintain a single connection or open only when i need to change something?

I have an SQL server on a server at home (which is an Atom processor with 1GB ram), and i'm using it to store data for one or two of my applications. I was wondering if i should create a DataContext object when the program starts then hold onto it for the entire life of the app, or only create the connection when necessary. What happens...

Absolute value in vb.net

How do you get the absolute value of a number in vb.net? Is there a function built in? I know I can simply code a function myself, but I want to know if there is one already there first. It seems so simple, I could probably make it in three lines, so I would be surprised if there isnt one.... Thanks! ...

Unit testing and the scope of objects - how to test private/internal methods etc?

Let's say I have a project that is a class library. I have a class in that library and this class has some methods that are used inside the class only. Like this: public class MyClass { public void MyPublicMethod { int k // do something ... int z = MyInternalMethod(k); // do something else ... } internal int ...

Instance of WMEncode causes crash (vb .net)

I'm trying to use the windows media encoder sdk to make a function to video capture my screen. I use the WMEncoderlib in VB .Net. When I do dim encoder as wmencode followed by encoder = new wmencode the program crashes immediately, no line numbers, nothing, vshost.exe even crashes when debugging. If I just say dim encoder as wmencod...

Variable expansion with Regex .NET style

I'm developing a small application with needs to replace .NET style "variables" in strings with their values. An example is given below: Replace: "{D}/{MM}/{YYYY}" With: "31/12/2009" I have decided to use Regex to find the occurrences of "{var}" but I'm not too sure how to properly go about it. ...

Problem with HTML Agility Pack and Visual Studio C++

I am in need of a very simple HTML parser which can extract text, table from well-formed HTML documents in the .NET environment. I found several references to HTMLAgilityPack. My problem is that I am using the Visual C++ environment in the .NET framework. Can anyone help me with instructions on how do I add a "reference" to the C# genera...

Marshal .NET Type across network

In Java you can do something like: byte[] code = ReadFromClassFile("SomethingSomething.class"); SendAcrossNetwork(code); And on the other end: byte[] code = ReadFromNetwork(); Class marshalledCode = CustomClassLoader.defineClass(code, 0, code.length); Object obj = marshalledCode.newInstance(); //Hey look, I've marshalled a class ove...

Unmanaged base class with Managed subclass

Is it possible to have: A pure abstract class (basically an interface) in (unmanaged) C++ Have managed implementations of this class in <insert .net language of your choice> Consume these managed implementations from (unmanaged) C++ Using SWIG or some C++/CLI glue? ...

Distinct not working with LINQ to Objects

class Program { static void Main(string[] args) { List<Book> books = new List<Book> { new Book { Name="C# in depth", Authors = new List<Author> { new Author { FirstName = "Jon"...

Strange XAML MenuItem DataBound ItemsSource Refresh Issue after empty ItemsSource

I have a XAML MenuItem DataBound ItemsSource that is working fine however there is a small issue. When I view the MenuItem and there is no databound items the ParentMenu will be disabled and it appears fine without binding errors (as expected the ItemsSource is empty). If the ObservableCollection is modified and an item added, the bind...

Set Application name in Task Manager's Applications Tab

I have a WinForms application written in C# for .NET 3.5 that needs to show a specific name in the Task Manager's Applications tab. However, I need for this text to be different from the Form's text. The behavior I've seen so far is that the Task Manager Applications tab will show the value of the Text property of the System.Windows.Fo...

Using Int32.Parse

Why is there a need to convert a value (for example short) to string, and then to Int32. Why can it not be converted from short to Int 32? ...

Screensavers With XNA and .NET?

I'm fairly sure you can create screensavers with.NET but are there any tutorials on doing so? and how well can you make XNA screensavers? ...

Possible to Compile ASP.NET to Machine Code?

Is it possible to compile a ASP.NET web application to Machine language? If so, are there any performance benefits? ...

How can I create a proxy to a remote object not derived from MarshalByRefObject?

In AppDomain A I have an object o of type T. T is neither Serializable nor derived from MarshalByRefObject. Type T is provided by a plugin host over which I have no control. I would like to create an AppDomain B and pass a proxy to o to a method in B, but am stumped: How to create the proxy? The method in B should be able to invoke met...

Unity and .NET Framework versions

Hi, I am looking to use an IOC container in my current project which is in .NET 2.0. Can anyone tell me what framework versions does 'Unity' work with, does it require .NET 3.5? I looked at the MS documentation and couldn't find anything about supported .NET versions. Regards, ilias ...