.net

How to pass filename to StandardInput (Process) in C#?

Hello Guys! I'm using the native windows application spamc.exe (SpamAssassin - sawin32) from command line as follows: C:\SpamAssassin\spamc.exe -R < C:\email.eml Now I'd like to call this process from C#: Process p = new Process(); p.StartInfo.UseShellExecute = false; p.StartInfo.RedirectStandardOutput = true; p.StartInfo.RedirectSta...

How to save Sharepoint rich text data into powerpoint file?

Hi all, I have a requirement to write sharepoint list data to powerpoint. Of all the fields, I am stuck with the Sharepoint rich text box control. I have this data in my list. This is a good time This is not a good time When I write the data into Sharepoint, it looks like. <div class=ExternalClassFAF287B8010F48B08705605F60E89938...

Change the Target Framework for all my projects in a Visual Studio 2010 Solution to 3.5 (or 4.0)

This is kind of a continuation of this question. The thing is that I have to change all the projects target framework. I have many solutions with hundreds of projects. Anything new here or do I have to change every single project? ...

XmlResolver Class' GetEntity function

I wrote a custom resolver class. It works OK for resolving SYSTEM DTDs, but not for resolving PUBLIC DTDs. When the class has to resolve PUBLIC DTDs instead of the URI of the resource, the function receives the public identifier through the absoluteUri parameter of the GetEntity function. Is there a solution to this. In examples: if I...

Entity Framework 4 simple Compiled Query internal exception on compilation

I want to retrieve one page from a sorted table. I want the sorting and paging to be done on the server. For this I created the following compiled query: internal static readonly Func<MyEntities, string, int, int, IQueryable<Model.Message>> MessagesPagedSortedByDateQuery = CompiledQuery.Compile((MyEntities db, string folderId, i...

Is there any Rendered HTML Diff engine for .NET

There are some questions on SO about Html diff engines, but i cant find right answer. What i need is .NET library for comparing two rendered html strings and displaying diff (like SO renders questions/answer editing revisions (example)). ...

Self Update in .net programs?

Hi, I`m looking for best mechanism for self update in .net programs! solution should cover this subject: 1) Server - Client Program 2) When new update released, after installing that on the sever-program, all client-program must update itself base on server version.(no need automatic-update for server) 3) Full-Update : for example if ser...

Need help in c# code

I have a function protected void bindCurrencies(DropDownList drp) { drp.DataSource = dtCurrencies; drp.DataTextField = "CurrencyName"; drp.DataValueField = "CurrencyID"; drp.DataBind(); drp.Items.Insert(0, new ListItem("Please Select")); } I am binding a dropdown list using this. But s...

Setting the cores to use in Parallelism

Hi, I have a feeling the answer to this is no, but using .Net 4.0's Parallelism, can you set the amount of cores on which to run i.e. if your running a Quad Core, can you set your Application to only use 2 of them? Thanks ...

Linq2SQL, Entities: Middle Tier or Data Access Layer

Folks, In a standard 3-tier architecture, where would you put your Linq2SQL dbml file? Is your answer the same for a ado.net entity data model? If the dbml file is in the middle tier, then do you have a data layer? Regards, Brett ...

Calling cli::array<int>::Reverse via a typedef in C++/CLI

Here is what I'm trying: typedef cli::array<int> intarray; int main(){ intarray ^ints = gcnew intarray { 0, 1, 2, 3 }; intarray::Reverse(ints); // C2825, C2039, C3149 return 0; } Compilation resulted in the following errors: .\ints.cpp(46) : error C2825: 'intarray': must be a class or namespace when followed by '::' ...

.Net Round-trip Types

I making a method that generate a unique string key for some parameters. But the same key if call with same values. I just accept primitive types, string, DateTime, Guid, and Nullable(since I append types together, I can distinguish who is int and who is int?), because I can convert all to string without lost values or precision.(for fl...

Difference between Thread.Sleep(0) and Thread.Yield()

As Java has had Sleep and Yield from long ago, I've found answers for that platform, but not for .Net .Net 4 includes the new Thread.Yield() static method. Previously the common way to hand over the CPU to other process was Thread.Sleep(0). Apart from Thread.Yield() returning a boolean, are there other performance, OS internals differe...

Get the file path of current application's config file

The reason I asked this question is that I wanted to create a helper class for Remoting instantiation, and wanted to pass the appropriate app.exe.config (or web.config) file path to the RemotingConfiguration.Configure method, depending on the caller. Is there a way I could get the name of the config file for both Win and Web apps withou...

Using Session in Silverlight using simple WebServices (NOT WCF)

Hi, I need to use Session variables in my Silverlight application ( Using Visual Studio 2008, and Silverlight 3). I am already using a webservice (not WCF service) and would like to know if I can add two methods say GetSessionVariable and SetSessionVariable in my existing WebService Class? Any assistance with sample code would be great...

Need help in listbox multiple select

I have a list box, filled with countries. A user can select multiple countries in the list box. <asp:ListBox ID="lstRegion" style="width: 115px;size:3px" runat="server" onselectedindexchanged="lstRegion_SelectedIndexChanged" SelectionMode="Multiple" > <asp:ListItem Text="Please Select" Value="" Selected="True"></asp:ListItem> </asp:...

How can you explore the managed heap in a .NET application to identify possible memory optimizations?

We have a .NET application which our customers consider too large for mass deployment and we would like to understand what contributes to our memory footprint and is it possible to do any better without completely abandoning .NET and wpf. We are interested in improving both Total Size and the Private Working Set (pws). In this question...

how can we create .svc file for WCF RIA services Class library

Hi, I am developing a Silverlight application with WCF RIA Serivces. now I want to deploy the WCF service on different server and expose services as .svc files. I have used WCF class Library but not able to find how can we deploy Services on the seperate server. Thanks, Sharad Rastogi ...

Consuming Odata service with .NET Compact Framework

Hi, I'd like to consume an odata service with a .NET Compact Framework 3.5 client application. What's the easiest way to do that? There are are clients for various programming languages in the odata SDK, but I could not find anything related to the compact framework. Am I missing something or do I have to use plain old HttpWebRequests...

How to get the right row in a sorted DataView?

Hi, I have a DataGrid containing a small table. Until now, I had a double click handler on this grid which iterated over all rows to find the selected one: DataTable table = (DataTable)this.dataGrid.DataSource; int selectedRow = -1; for (int i=0; i<table.Rows.Count; i++) if (this.dataGrid.IsSelected(i)) selectedRow = i; break...