.net

Not able to find repeater inside FormView

I'm not able to locate the repeater controller called 'repScore' which is located inside the FormView controller. This is my code: <asp:FormView runat="server" id="fwHotelDetails" DataKeyNames="id" OnDataBound="fwHotelDetails_DataBound" > <ItemTemplate> // (..) some code here which outputs some data <asp:Repeater r...

Bin deploy rake (and IronRuby)

I'm on a .NET project, and I would like to migrate build script from MsBuild to Rake. I don't want to force developers (or build agent machines) to have to install anything, I want it to be self contained. If possible I'd prefer to use IronRuby. Is it possible to just drop everything in /tools/rake and /tools/IronRuby and have it just w...

O/RM Choice (not reliant on linq)

Hey Everyone, I like using SQL, and I think I am pretty good with it. And I tried to use Linq (with c# and Linq2Sql, looks like it feels more SQL-like with VB.Net), I feel it is very frustrating, you cannot just run your query without compiling and executing the code. I am not so great with IQueryable, IEnumarable, IList etc. And I hav...

Is it true that I can still use Linq to SQL in design time even if you are targeting .net 2 in your application?

Hello, Someone recently said that I can use Linq to SQL in my application even if I am targeting the .net 2 framework. Is that true? How does that work? How do you setup your references? Any gotchas I need to be concerned about? Is there some special way to set that up? Thanks. Seth ...

.NET Remoting in AddIn VS2008 not working?

Hi, I just started with AddIn development and have a small problem. The following code is working nice inside a console application: Trace.WriteLine("Started"); var channel = new TcpChannel(8083); ChannelServices.RegisterChannel(channel, false); RemotingConfiguration.RegisterWellKnownServiceType(typeof(Re...

SerialPort reading cause error because of not owning thread

I have a simple WPF windows application trying to read a serial port with the System.IO.Ports.SerialPort. When I try to read the incoming data in the DataReceived event, I get an exception saying that I don't have access to the thread. How do I solve it? I have this in the WPF window class: Public WithEvents mSerialPort As New Seri...

Immutable types as configuration properties

Is it possible to use immutable types as configuration properties with .NET's configuration API? Let's say I have an immutable type called MyClass: public class ImmutableClass { private readonly int value; public ImmutableClass(int value) { this.value = value; } public int Value { get { return ...

Increment a byte[]

Hi all, I have a byte[] testKey = new byte[8]; This obviously starts with all bytes as 0. I want to go through all the bytes and increment by 1 on each iteration of the loop so eventually I go through all possibilities of the byte array. I also want to do this as FAST as possible. Yes I am trying to write a brute forcer. Update I ...

How do I check whether File.Delete() will succeed without trying it, in C#?

Hi, In C#, System.IO.File.Delete(filePath) will either delete the specified file, or raise an exception. If the current user doesn't have permission to delete the file, it'll raise an UnauthorizedAccessException. Is there some way that I can tell ahead of time whether the delete is likely to throw an UnauthorizedAccessException or not ...

.NET Library For Fixed Length Text Files

I'm looking for a .NET (much preferably open source in C#) library for dealing with fixed length field text files. It wouldn't be too much to write one, but existing, tested work is always nicer, to start with. I will be extracting data in fixed length fields from files produced by a PBX. Each PBX has its own file format, as well a se...

FileStream with DeleteOnClose File option

In my project I have to create some temp files in an USB device, which I want to delete on Closing. So I used a code like this.fcommandHandler = new FileStream(TempFileName, FileMode.CreateNew, FileAccess.ReadWrite, FileShare.ReadWrite, 512, FileOptions.DeleteOnClose); It works fine. But the problem is I want to use one more FileOptio...

The FormView 'x' fired event ModeChanging which wasn't handled.

Ok, so I'm struggling with using asp:formview. I've got the formview up and running and I've added the 'Edit' button. <asp:FormView runat="server" id="fwHotelDetails" DataKeyNames="id" OnDataBound="fwHotelDetails_DataBound" OnModeChanging="fwHotelDetails_ModeChanging" > <ItemTemplate> // (..) some code here which outputs s...

SQL Server express edition issue

Hello everyone, I want to know SQL Server Express edition, like SQL Server 2008 Express edition, whether totally free or not (e.g. free for a period of time or free for ever)? I heard no management tool like SQL Server Management Studio for Express edition, is that true? If I have some code which works on SQL Server Enterprise edition...

Commercial version control

My boss wants me to think about what to use for version control. I am a big fan of subversion, bazaar, mercurial, etc. However, we have a policy at our shop to not use open source tools! Does anyone know of any good commercia/proprietary version control tools? We are a .NET shop and I know about Visual SourceSafe. However, I have heard ...

How can I trigger a control event when a ListViewItem is selected?

I have an image that I want to show only when a ListViewItem is selected. The code I have isn't working, but I think it illustrates what I want to accomplish. <GridViewColumn> <GridViewColumn.CellTemplate> <DataTemplate> <Image Height="20"> <Image.Style> <Style TargetType="{x:Type Image}"> ...

Windows service problem - LocalSystem account cannot read file

I have created a Windows service to open the IIS log, read content, then e-mail this content to consultants that 'The Man' doesn't want to have any access to those servers. On my local machine, everything works great, and the file generated from parsing the IIS log for the day is e-mailed to the recipients. I do not have access to insta...

Is there a newer version of asp.net membership provider?

Back in 2006, Scott Gu blogged about how the source code was available for the ASP.NET Membership Provider here. That was 3 1/2 years ago! Does anyone know if Microsoft has made any improvements to this provider and if there is updated source code? I would like to use the source code to create a custom provider but I know (in my heart...

Share first level cache between different sessions?

Is it possible for different NHibernate sessions to share one 1st level cache? I`ve tried to implement it using interceptors and listeners. All works fine except Session.Evict(). public class SharedCache : EmptyInterceptor, IFlushEntityEventListener, ILoadEventListener, IEvictEventListener, ISharedCache { [Thread...

Can creating a C++ control and using it in C# gain performance?

In reality, I am trying to create a control showing price depths of a stock which needs to accept a large number of messages and summarizing them for display purposes. Will I get a better result if I create it in MFC and use that control in my .Net Winform application than writing the whole thing in .NET? ...

Is this the appropriate way for a .NET application to auto-run at startup?

I'm teaching someone better practices by refactoring a large project they worked on. One of the current functions of the application is the option to have the application start when Windows starts. Currently, the application accomplishes this using the Run registry key: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run ...