.net

How to handle variation in service method inputs

Hi, I have a client application that should be able to handle the following: 1) Request sql statments that are to to be executed against the client. 2) Request Service Packs or Hoxfixes that will be executed against to the client. 3) There may be more types of tasks the client could do in the future. Executing each of these task types...

Linq-To-Sql Method Not Supported?

I'm using a query that tries to find a matching unique identifier (guid) such as var myUsers = from u in table where u.UniqueIdentifierId == MyClass.GetCurrentUserId() select u; This throws the Method Not Supported error for my custom function. I recoded it to do this string guid = MyClass.GetCurrentUserId...

Using WebRequest.Create inside RenderControl() for WebParts

I need to call a web service to receive a JSON object which I'll parse before rendering the content. Here's the code for the same: Dim jResponse As MessageResponseWrapper = New MessageResponseWrapper() 'Custom class to deserialize JSON Dim req As System.Net.HttpWebRequest req = System.Net.WebRequest.Create("http://some-c...

Transfering a File with a NetworkStream then rebuilding the file fails.

I am trying to send a file over a NetworkStream and rebuild it on the client side. I can get the data over correctly (i think) but when I use either a BinaryWriter or a FileStream object to recreate the file, the file is cut off in the beginning at the same point no matter what methodology I use. private void ReadandSaveFileFromServe...

How and what CMS package to integrate with a .NET website

Hi, I am looking to develop a website mostly consisting of static pages. I need to provide the ability to allow the site owners to be able to log on to an administrative section of the site and update the content (text, links, images etc) themselves. I am most likely going to develop the site using .NET. Can anyone recommend an open ...

Understanding assembly header with corFlags (why my assembly loads in 32bit address space?)

Hi all, I've found a fair bit of information related to how a .NET assembly should load based on the flags set in the assembly header. Pages such as http://blogs.msdn.com/b/joshwil/archive/2005/05/06/415191.aspx seem to suggest that if you have a header as follows PE : PE32 ILONLY : 1 32BIT : 0 It has been compiled as "AnyCPU" an...

Why am I getting exception when binding IList to a combo box?

I have the following classes/interfaces. I'm getting an ArgumentException saying "Complex DataBinding accepts as a data source either an IList or an IListSource". But, I am setting it to an IList. What am I doing wrong? public interface IOriginList : IList<IOriginEntry> { ... } public class OriginList : Interfaces.IOriginList { ...

Visualize/Edit Business Object's Properties in WPF

I am new in WPF and wondering about business properties visualization approach in WPF. I explain myself: I am a city architect and draw a city plan. My city is a canvas with rectangles, representing houses. I can drag rectangles on the canvas. Now, I need to edit house's properties when I select a house. Is there a WPF way to do it...

Entity Framework Contextual Validation

How would you implement validation for entity framework entities when different validation logic should be applied in certain situations? For example, validate the entity in one way if the user is an admin, otherwise validate in a different way. ...

Why is Int32 a value type?

Why does System.Int32 that derives from System.Object (thru System.ValueType) a value type while System.Object is a reference type? ...

Why my LINQ expression do not work in LINQ to SQL?

private System.Linq.Expressions.Expression<Func<ActionLogs, bool>> GetExpression() { Expression<Func<ActionLogs, bool>> expr = w => w.ID != -1; if (ActionDate != null) { Expression<Func<ActionLogs, bool>> byDate = w => w.DateAction == ActionDate; var body = Expression.AndAlso(expr.Body, byDate.Body); e...

Open Source hospital or medical insurance related MIS or Hospital Information System in .NET

Hi, I am currently working on a Hospital Information System for the government and I wanted to know if there is a open source (Even a sample or a base not used worldwide) software or even a sample database available to download to get some fresh ideas. If not, is there any information on design and analysis the processes within the hospi...

Need to create ChartObject in PowerPoint based on the C# chart control

Hello! I'm creating a variety of graphs within my application which are based on the .Net Chart control (using System.Windows.Forms.DataVisualization.Charting). What I'm trying to do is to allow users to copy these charts to Power Point in the "native" format, i.e. to enable them to paste special in PP and see "Microsoft Office Graphic ...

VB.Net .Clear() or txtbox.Text = "" textbox clear methods

Hey guys, not far into programming and just joined this forum of mighty company so this is a silly question, but what is the best way to clear textboxes in VB.Net and what is the difference between the two methods? I have also seen people be critical of folk using clear objects on their forms and i can see why but in this case, i am only...

How to filter Directory.EnumerateFiles with multiple criteria?

I have the following code: List<string> result = new List<string>(); foreach (string file in Directory.EnumerateFiles(path,"*.*", SearchOption.AllDirectories) .Where(s => s.EndsWith(".mp3") || s.EndsWith(".wma"))) { result.Add(file); } It works fine and does what I need. Except f...

Unable to delete PST file after extracting from Outlook.

For some reason, I am unable to delete a PST file after I have extracted it out of Outlook using .NET code. The code I'm using is from: http://stackoverflow.com/questions/1724789/how-can-i-create-an-outlook-pst-file-using-net. Is there anything I can do to release the lock at the end of extracting out the PST file? According to this p...

Interop Word - Delete Page from Document

Hi, What is the easiest and most efficient way to delete a specific page from a Document object using the Word Interop Libraries? I have noticed there is a Pages property that extends/implements IEnumerable. Can one simply remove the elements in the array and the pages will be removed from the Document? I have also seen the Ranges and...

Random number generator returning zeros

I have an ASP.NET application that relies on the Random class to generate a pseudo-random string. It uses the following code (this is part of a larger piece of sample code provided by Google for apps SSO): public static class SamlUtility { private static Random random = new Random(); private static char[] charMapping = { ...

Multiple copies of data in datatable

How many copies of data does the datatable store ? I found this question from a year before but not a whole lot of details on there ? http://stackoverflow.com/questions/424598/what-is-the-memory-overhead-of-storing-data-in-a-net-datatable Spefically, when do the copies get created? Are they flushed only on .Save() / .Update() ? I have...

How to become an expert in WPF?

Yes, indeed. To anybody who's sole goal is to become an expert in WPF (or you already are) what would you recommend doing to achieve this goal? What books would you recommend going through? What topics to cover in detail? What achievements to make to become an expert? Would you recommend to become an expert in other areas as well (.ne...