.net

Licensing WPF application

Does anyone have any guidance on the best way to manage licensing for a WPF application? I would like to have different levels of licensing (Free, Trial and Professional). The app itself will probably be distributed with a WiX installer (if that makes any difference) ...

Creating excel template 2003 in C# on a machine with both 2003 and 2007 installed.

I have both 2003 and 2007 Excel versions installed on my machine. The current source code uses Office11 (2003) interop assembly Microsoft.Office.Interop.Excel.dll to create the Excel template. When I create the template and open in Excel 2007, it opens perfectly. The same template when I open in 2003 I get the message "File format is no...

Use the same log4net assembly in .NET and Mono

Hi, I've downloaded log4net, but I've realised that there are different assemblies for .NET and Mono. Is possible to use the same assembly for .NET and Mono? I wouldn't like to have to recompile the application or change the file manually, is there a way to add one or add the two and put a condition somewhere? Cheers. ...

How to make a Generator for Stored procedure ?

i try to write a generator or i want to write all stored procedures(SP) in C# side. how can i do that? 1) writing a sp generator OR 2) Coding all sps via C# OR 3) Writing All data process (SP) via Linq which one is best or your advise? ...

Is there added overhead to looking up a column in a DataTable by name rather than by index?

In a DataTable object, is there added overhead to looking up a column value by name thisRow("ColumnA") rather than by the column index thisRow(0)? In which scenarios might this be an issue. I work on a team that has lots of experience writing VB6 code and I noticed that didn't do column lookups by name for DataTable objects or data gri...

Install client with system.data.sqlclient.dll

I am install an c# winforms app 3.5 to a client that references a mdf file that will in SQL server express. I installed .net 3.5 sp1 so the latest .net data providers for SQL server should be there?? I am getting an error for system.data and the above dll. What are the dependencies am I missing? ...

Why can I not do a Messagebox.Show(some_int) ?

MessageBox.Show((some_string.Length).ToString); I am getting two errors for this: The best overloaded method match for 'System.Windows.Forms.MessageBox.Show(string)' Argument '1': cannot convert from 'method group' to 'string' Can someone tell me how to do this correctly? ...

Convert .net String object into base64 encoded string

I have a question, which Unicode encoding to use while encoding .NET string into base64? I know strings are UTF-16 encoded on Windows, so is my way of encoding is the right one? public static String ToBase64String(this String source) { return Convert.ToBase64String(Encoding.Unicode.GetBytes(source)); } ...

.NET Message Queuing using SQL Server as Message Storage

Hi, I'm looking for a MSMQ alternative which use SQL Server as messages persistance since MSMQ as some limitations : 4Mb Message Size, 1.6Go Queue Size ... Is there any open source or free project doing that ? Thanks. ...

How do I dynamically tell a .NET MVC application which datasource to point to?

I'm beginning a port of an existing ColdFusion application to .NET MVC and one of the first issues I'm running into is that in ColdFusion we use the fact that you can define multiple datasources and access them in a dynamic way so that a particular user can be pointed at a particular database. To give an example, I might have two databa...

Problem with InlineUIContainer

I have an Windows.Documents.InlineUIContainerin a RichTextBox, and sometimes it's font size of alignment change when I hit key combination such as Ctrl+Space. I couldn't find any place to handle these events and block them somehow. I don't want to block it in the RichTextBox. I am more looking for a way to block it only on the InlineUICo...

Can a .NET application targeted for "Any CPU" use P/Invoke calls in multiple environments?

I have a .NET application that uses some API calls, for example GetPrivateProfileString. So far it has always run on 32-bit machines. In order to run on 64-bit machines, must I change the "Platform Target" to "x86"? Or is there a way to let the runtime know which API DLL to invoke depending on the runtime environment? ...

Does Google not allow webclients?

I have the following: string html_string = "http://www.google.com/search?sourceid=chrome&ie=UTF-8&q=pharma"; string html; html = new WebClient().DownloadString(html_string); and when I get the length of HTML, it's returning only the first 28435 characters. Is it possible that Google is not allowing webclient access? ...

If we cannot retrieve output parameters until SqlDataReader is closed, then why...?

1) While the SqlDataReader is being used, the associated SqlConnection is busy serving the SqlDataReader, and no other operations can be performed on the SqlConnection other than closing it. This is the case until the Close method of the SqlDataReader is called. For example, you cannot retrieve output parameters until after you call ...

Why would a WebService return nulls when the actual service returns data?

I have a webservice (out of my control) that I have to talk to. I also have a packet-sniffer on the line, and (SURPRISE!!!) the developers of the webservice aren't lying. They are actually sending back all of the data that I requested. But the web-service code that is auto-generated from the WSDL file is giving me "null" as a value. UP...

How to add a service to the type descriptor context of a property grid in .Net?

I have an app that allows the user to choose an image, at design time, either as a straight image, or from an image list. All cool so far, except that this is not happening from the visual studio property browser, its happening from a property grid that is a part of a type editor. My problem is, both the image picker (actually resource...

Targeting .NET Framework 4.0

I just downloaded MSVS 2010 from university MSDN AA. The IDE itself is wonderful, I can't complain, but... I'm developing project that combines C#, C++/CLI and C++ (native core, cli bridge DLL and c# GUI). But the VS 2010 seems NOT TO support targeting .NET for C++/CLI projects unless VS 2008 is installed. Requiring both VS 2010 and 20...

Proper way to structure a Sync Framework DAL

I am creating a WPF app that needs to allow users to work in a temporary disconnected state and I plan to use a Local Database Cache. My question's are about my data access layer. Do you typically create the whole DAL to point at the Cache or both and create a switching mechanism? Is Entity's a good way to go for my DAL against the ...

How to Write to a User.Config file through ConfigurationManager?

I'm trying to persist user settings to a configuration file using ConfigurationManager. I want to scope these settings to the user only, because application changes can't be saved on Vista/Win 7 without admin privileges. This seems to get me the user's configuration, which appears to be saved here in Win 7 ([Drive]:\Users\[Username]\A...

Rewrite URL in IIS7 .NET MVC

Hi, I'm trying to rewrite the url: https://mydomain/phone-append to https://mydomain/Service/PhoneAppend using the following rule: <rewrite> <rules> <rule name="Phone Append"> <match url="phone-append" /> <action type="Rewrite" url="/Services/Index" appendQueryString="true" /> ...