.net

cannot convert string to char

I got some help on here last night about getting an the index of a collection. Here is the code I'm using. System.Text.StringBuilder sb = new System.Text.StringBuilder(); for (int i = 1; i < _prod.ActiveProductItemCollection.Count; i++) { sb.Append("<script type='text/javascript'>")...

Custom actions in a .NET Service Installer

I am writing a Windows Service in C# in Visual Studio 2010. My service will require a registry key HKLM\system\currentcontrolset\services\myservicename\parameters. It will also require a custom event source. I can't create either of these from within the service because both of these actions require running elevated on Win7, and I don't...

SoapHttpClientProtocol/HttpWebClientProtocol connection status

I have a WebService reference (.NET CF 3.5) based on SoapHttpClientProtocol. My question is - is there a way to determine whether a connection to WebService is established other than calling a web method? Can I check at any time that the underlying connection is established and get its status? Regards ...

DataContract serializer support for imports. Out of band mechanism?

Describing the DataContractSerializers support for import msdn has this to say: Supported. DataContractSerializer supports xs:include and xs:import. However, Svcutil.exe restricts following xs:include/@schemaLocation and xs:import/@location references when metadata is loaded from a local file. The list of schema files must be passed th...

Why Do my WPF TreeView Items Look Like This?

In learning WPF, I (perhaps unwisely) chose to display my XML data (wisely parsed with LINQ) in a TreeView. But when I load it into a TreeView, it looks like this: The XAML is as follows: <TreeView Name="StoryTree"> <TreeViewItem Name="TreeGeneral" Header="General"/> <TreeViewItem Name="TreeCharacters" Header="Characters" /> ...

Differences between powershell and ruby

I am new to the dynamic languages scene, and trying to find a good starting point. Looking at how Microsoft is diminishing the role of Iron Ruby in its offerings, I am looking around for a dynamic programming language that will be supported on dotNET platform. Could you list specific features that are found in one but not the other, to...

.net scripting languages

what do people use for scripting in .net apps. New question after MS drops IronPython IP used to be my favorite; then Lua What do I mean by scripting. I mean I have a large system management tool that allows users to plugin bits of smartness, this include assemblies and scripts. What language should I use for the scripts. So I need an ...

Architecting a system for bulk processing data with metrics

I'm looking for ideas on how you'd architect a system like so: Records come in in bulk (say 100,000 at a time) from a variety of sources but primarily a flat text file. This data needs to be shoved as-is into a SQL Server database table. However, various metrics need to be computed. For example, one field is a certain 4-digit code. Onl...

Use Mono Runtime instead of Microsoft's on Windows for Monodevelop

Even though I set Mono to the default .NET Runtime on Windows, it insists on using Microsoft .NET framework. Can Monodevelop be configured to use the mono runtime as the runtime environment to execute itself? How and where do I configure this setting? ...

FileStream.ReadByte - Inefficient - What is the meaning of this?

The default implementation on Stream creates a new single-byte array and then calls Read. While this is formally correct, it is inefficient. Any stream with an internal buffer should override this method and provide a much more efficient version that reads the buffer directly, avoiding the extra array allocation on every call. ...

How to show a form's custom property at design time?

I have a form where I have created a custom property, DataEntryRole, and set its Browsable attribute to True, as shown: <Browsable(True)> _ Public Property DataEntryRole() As UserRole.PossibleRoles Get Return mDataEntryRole End Get Set(ByVal value As UserRole.PossibleRoles) mDataEntryRole = value End Set ...

FileShare.ReadWrite what additional permissions are needed?

The MSDN documentation for FileShare.ReadWrite says: FileShare.ReadWrite Allows subsequent opening of the file for reading or writing. If this flag is not specified, any request to open the file for reading or writing (by this process or another process) will fail until the file is closed. However, even if this flag i...

Best Approch for Generic Authentication Framework

Hi We have got multiple application that uses different way of authetication to authenticate user. Almost all application are developed in WPF but there are few application which are developed in ASP.NET and Silverlight. Our ultimate goal is that every application that we had developed already and those we develop in future will use a ...

c# - How to import external data (.csv file) as a new worksheet without opening another workBook/excel application

Hi My target is to open many .csv files, each of them in a new workSheet in the same excel workBook, without opening a workBook for each. I noticed that the Open() or OpenText() methods belong to the workBook class and using them means opening a new workBook. To be more clear, a regular user would simply do this in Excel 2003 by selec...

Is there a way to set the maximum number of message redeliveries in ActiveMQ when using the Apache.NMS libraries?

I'm using Apache.NMS 1.4. I need to be able to programmatically set the maximum number of times a message can be delivered before being placed in the DLQ (Dead Letter Queue). Is there a way to do it? ...

Convert string to Date - C#

How would I be able to convert a string like "On Monday 25th March 2010..." to 25/03/10? Also, is this possible? ...

.NET equivalent of Delphi IStream initialization

I have the following Delphi code: var Stream: TMemoryStream; StreamI: TStreamAdapter; OleStream: IStream; begin Stream:= TMemoryStream.Create; Stream.LoadFromFile(filename); StreamI:= TStreamAdapter.Create(Stream, soOwned); VSPDFViewer1.LoadStream(StreamI as IStream, ''); end; Which actually passes an IStream object to a COM c...

.net Cryptography - is there a way to tell that something has been decrypted wrong?

See the title for question. In a nut shell, what I am trying to do is encrypt some data with the seed (keyword) provided by the user. Is there a way to know that the data has been decrypted wrong, or in other words that the seed is wrong? Using .net 2.0, C# Thanks! ...

Gui Automation, Install/Uninstall software automatically

Hi, Can anyone please tell me about any open source software which will install and uninstall software automatically without taking input from user for installation steps. Any related material will be highly appreciated. ...

WCF Service Not Connecting to SQL Database

Problem When making calls to a SQL database from a WCF service we receive the following error: "A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to...