.net

How can I make this application re-usable?

I made a .NET Windows form that allows users to view a particular document and sign it. I want to make it re-usable for future applications. The challenges are: The text to be signed requires parameters. Before the user signs it, the text is just a query - not saved anywhere When the user signs it, the text he/she signed must be sto...

looking for a free(non commercial) log viewer with filtering and searching functions for database logs?

I am using log4net to log to a database, and I was requested to find a tool to filter and search through the logs in the database. I dealt with log file viewers before and i found LogExpert which is log file viewer completely free and it provides many functionalities such as search, filter and highlight. So i am looking for something lik...

Is Thread.Abort() corruption localized?

I understand that calling Thread.Abort() is BAD AND WRONG because of various reasons Can be locking or in other critical region Could be midway through an I/O operation, resource won't get cleaned up Code can swallow ThreadAbortException Could be midway through a state change operation, and leave the program in an invalid state. Assu...

c# do if( a == (b or c or d)) is it possible ?

is there another way to write something like this: if(a == x || a == y || a == z) one way that I found is doing like this: if( new [] {x,y,z}.Contains(a)) anybody knows any other good ways ? ...

Entity Framework SELECT 1 AS C1

OK, probably a really stupid question, but why is the query being generated by Entity Framework include "SELECT 1 AS C1" at the beginning? What is this for? For example, I have the following being generated: SELECT 1 AS C1, "Extent1".MY_ID AS MY_ID FROM MYTABLE "Extent1" WHERE 'test1' = "Extent1".MY_ID If I had written this manually...

Finding a word - String Operationg or Linq

Hey All, I have a string full of a few hundred words. How would I get each "word" (this can also be a single letter number or punctuation), and as each "word" is found, it is removed from the string. Is this possible? Example: String: "this is a string full of words and letters and also some punctuation! and num6er5." As far as th...

how can i get image from listview and assign to picturebox ?

Hi, i have one listview in which i have stored images, now for my slide show i want this images to picture box. but not getting exact way to get images from the listview. can anybody has some idea about this ? thanks in advance. ...

Java equivalent of .NET Action<T> and Func<T,U>, etc.

Are there any standard generic "callback" or "function/method" types in Java, like System.Action<T> or System.Func<T,U> in .NET? In my concrete case, I need a class that wraps a method that takes one (generic) parameter of type T and returns nothing (i.e. void). It's a Sping+JSF web application. Yes, it's easy enough to create such a c...

disable and select asp.net mvc Html.RadioButtonFor

How can i set selected = true and disable this radio button <%= Html.RadioButtonFor(m =>m.AddToLevel ,new {id = "rdSameas" }) %> ...

WCF - Transport Authentication - Get Credentials of Authenticated User

Hi, I have a NetTcpBinding with SecurityMode.TransportWithMessageCredential. Transport.ClientCredentialType is set to MessageCredentialType.Windows, but I'm considering MessageCredentialType.UserName. Then there's a class DataStoreServerProxy for fetching database data which implements IDataStoreContract. It contains methods such as ...

How to debug AccessViolationException coming from native code

I'm writing managed code, and I'm using managed bindings (qt4dotnet) for an unmanaged library (Qt). Now and then, I get an AccessViolationException coming somewhere from Qt, but I don't know how to debug that. I don't even get a stacktrace further than the managed/unmanaged boundary (meaning I don't know what part of Qt crashed on me). ...

Named parameters order has sense for MySql .Net data provider?

I found that in my project order of named parameter has sense. I call this procedure CREATE PROCEDURE `test`.`TestProc` ( in myText varchar (5), in myText2 varchar (100) ) BEGIN END If I add parameters like this: command.CommandText = "testProc"; command.CommandType = System.Data.CommandType.StoredProcedure; comm...

How do I register a DbProvideFactory?

I am trying to create a new ADO.NET connection string using the 'Add Connection' dialog. I click the 'Change' button to change the selected 'Data Source' but can't see the desired data source in the list of registered data sources. Now, I know I need to update the machine.config file 'DbProviderFactories' element with the appropriate e...

Upgrading COM+ to C# code

Hi, We have an application which was written using COM+ objects(.NET v1.1) and right now we want it to be upgraded to C# code(.NET v3.5). Please tell what all difficulties i will be facing? ...

Difference between these two accessor/getter/setter methods?

Whats the difference now between doing this: public string Title { get; set; } and this: public string Title; Back in the day people always said use accessor methods with private variables called by the public accessor, now that .net has made get; set; statements so simplified that they look almost the same without the private vari...

Should I carry on porting FPDF to .NET?

I've started to port FPDF to .NET, however I was wondering if its worth the effort. Has it already been done? I'm aware of ASP FPDF, but I'm talking about creating a native .NET dll so that any .NET language can use it. I plan to make it public for any one to use. Further I'm not familiar with PHP, what tips/advice can you give (in t...

How to authenticate .NET2 Webservice with a SQUID proxy

I've got a little utility that is a SOAP WebService client. The SOAP-proxy is generated from WSDL. It was working fine. Now the customer wants to use a SQUID proxy, but that refuses to authenticate my SOAP client. I have already tried: MyWebservice ws = new MyWebservice(); // set URL etc. // login for the actual service, this part...

Is CLR loaded and initialized everytime,when a new managed application is loaded ?

Is CLR loaded and initialized everytime, when a new managed application is loaded and there is a managed application already present? e.g. If on my machine, application "TestApp" is running and after that I start another application "DemoApp". In this case, wiill CLR be loaded again for DemoApp? Or it will use the same one which is load...

What field of PE Headers tells that whether a valid PE file or not?

Hello, i need to validate whether given binary is a PE file or not. e.g if I rename jS/HTML or .class files to .exe or .dll , it won't be PE files still then. Parsing PE these files would give me info about this problem. What field indicates that given binary is a valid PE file or not..? Note : I have checked about "e_magic" field of ...

How to exchange window content dynamically in WPF

Hey everybody! I need help on developing a WPF UI. I'm new to WPF. So far I read many tutorials and decided to follow a MVVM design pattern. What I want to accomplish might seem simple: There is a ComboBox at the beginning of a window. It's embedded in a Grid with two rows. Now I want the content of the second row to depend on the sele...