Hi,
Hopefully an easy one, I have created a Custom Repeater control that extends System.Web.UI.WebControls.Repeater. I Have added two ITemplate Properties to this control and add these when required and in the desired manner. Everything is working absolutely fine but I'm having a problem in Visual Studio having these new Templates reco...
How do I obtain the version number of the calling web application in a referenced assembly?
I've tried using System.Reflection.Assembly.GetCallingAssembly().GetName() but it just gives me the dynamically compiled assembly (returning a version number of 0.0.0.0).
...
Is there any global event in .NET Windows Forms and WPF applications, equivalent to On_Error in ASP.NET - Global.aspx?
...
I found the following example on http://www.erictobia.com/2009/02/21/LoadADataTableWithLINQ.aspx
Unfortunately, I need it in VB and it's using some constructs that neither I nor the automated code converters reciognize. Anyone out there know how this should be written in VB.Net? (the problem spot is the "select new {...")
PeopleData...
I use log4net all the time, but one thing I've never figured out is how to tell what's going on on the inside. For example, I've got a console appender and a database appender in my project. I made a few changes to the database and the code, and now the database appender doesn't work anymore. I'll figure out why eventually, but it would ...
We have an application that stores a sparse matrix. This matrix has entries that mostly exist around the main diagonal of the matrix. I was wondering if there were any efficient algorithms (or existing libraries) that can efficiently handle sparse matrices of this kind? Preferably, this would be a generic implementation where each mat...
I have a very strange requirement using DataTable. I have a datatable with some columns. Nwo whenever there is any change in any of the DataRow in the datatable; then the state of DataRow is set to modified. That is OK. But for one exceptional column I don't want this behavior. I want that any change in any row for this particular column...
I'm trying to use the TSql100Parser.ParseStatementList method to programatically parse sql statements and pull out object names. This is from the Microsoft.Data.Schema.ScriptDom.Sql namespace. Here's the code:
string sql = "CREATE VIEW testView AS SELECT * from testTable";
var parser = new TSql100Parser(false);
StatementList parsedSta...
I would like to introduce unit testing to our C++ product and wanted to investigate the pros and cons of trying to use the CLR-based unit tests. I've read that if you compile with the /clr:safe option, you can call your existing C++ code.
I'm strictly a .NET developer, so I'm at a loss for how this would affect our codebase. What shou...
Does the absolute value protect the following code from the Environment.TickCount wrap?
If Math.Abs((Environment.TickCount And Int32.MaxValue) - StartTime) > Interval Then
StartTime = (Environment.TickCount And Int32.MaxValue)
.
.
.
End If
Is there a better method of guarding against the Environment.TickCount() wrap?
(This ...
The situation is as follows.
public interface IFoo { }
public abstract class FooBase : IFoo { }
Now I need a collection of IFoo with some additional methods.
public class IFooCollection : List<IFoo>
{
public void UsefullMethod() { }
}
The problem is that IFooCollection looks like an interface while it is a class. The options ar...
Howdy.
Does anyone know how to write an ExpressionHelper.GetName method so I can get the name of a public static/const property or field using Reflection and C# 3.0
So for
static class B
{
public const string Field = "mittens";
public static string Prop = "the kitten";
}
The following asserts would work (the syntax is obviously...
I'm using ASP.Net AJAX and I created a web service in my application. The service has one method (AddWatchedFolder) and it takes a Name.Space.WatchedFolder as the only parameter. The problem is, ASP.Net AJAX isn't generating a javascript type for Name.Space.WatchedFolder even though I've added the service to a ScriptManager.
I am able t...
Edit: I have asked question to understand why C# designers chose it to behave in particular fashion?
Similar question has been asked, but this is little different.
Should following code give warning?
class Foo { public void Do() { /*...*/ } /*...*/ }
class Bar : Foo { public static void Do() { /*...*/ } /*...*/ }
It gives: "warning...
Hi all,
i need to insert a progress bar between 2 forms ,i have a Main Form when i click a button to open a window i need wait before to load the last one window ('cos there are many picture to download on the last one Form) and i decide to use a Progress Bar to show the time remaining to open the Window requested.
Now i don't know how i...
My objective is to move visual elements drawn using methods of a Graphics object across a Form with no flicker or artifacting (in .NET 3.5). I can successfully achieve flickerless movement by either using automatic double buffering (setting the Form's DoubleBuffered property to true) or implementing a back-buffer myself. I am however s...
I have a small SQL Server database that I need to copy on command -- I need to be able to take the mfd and ldf files at any given moment, copy them, zip them, and make them available to an end user.
Right now this is possible by manually:
1) Logging onto the SQL server via Remote Desktop
2) Detaching the database via SQL Management St...
I'm running a WCF service in IIS7 with Username authentication and Message Security.
A client wants but develops using GRAILS. How do they go about connecting and authenticating with the service?
Any information would be greatly appreciated thanks.
...
I've written the following (very simple) control for use in an application (comments removed for brevity):
public partial class HorizontalRule : Control
{
public HorizontalRule()
{
InitializeComponent();
}
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
var g = e.Graphic...
I want to use the same style for all Images and AutoGreyableImages (my custom control that inherits from Image). I have the following style declared application-wide:
<Style TargetType="{x:Type Image}"
x:Key="ImageType">
<Setter Property="Stretch"
Value="Uniform" />
<Setter Property="Height"
Value="1...