I have an ADO .Net Entity Data Model for my database. In this Model I have three related tables:
"Users" Table containing UserId and other details.
"Run" Table that contains RunId, ApproverId and other details
"RunToUser" that contains UserId and RunId columns
The relationships are as follows:
Users.UserId is a one to one relationship ...
I am trying to get the new System.Diagnostics.Eventing event logging working in a simple .Net app before integrating it into my application.
Working off of this page, I created a manifest, built a simple app that fires an event and registered the provider to see it in the event viewer. I don't get any errors in event viewer or my sampl...
For instance, parameters in a method that use the "out" keyword in C# will show up in the metadata signature preceded by an ambersand "&". I'm trying to create the signature for a generic method but I don't want to use the metadata APIs to figure this out, surely it's documented somewhere?
Here's an example of what I mean for BeginRecei...
I have an application that connects to a number of SQL Servers for monitoring and other tasks. Currently, I only support trusted authentication, since I don't have to store anything sensitive. I want to add the ability to use SQL Authentication (username/password).
What's the best approach to storing this sensitive data between sessions...
Hello,
I'm trying to figure out an architecture for plugins, but I've never worked with that. Essentially, my Program supports multiple database backends, but only one at a time.
my idea was now to create a new Assembly (".DataCore") that contains all my Repository Interfaces (IFooRepository, IBarRepository) and a IDataPlugin Interface...
This should be an easy problem but...
I need to format a currency for display (string) in C#
The currency in question will have its own rules such as the symbol to use and if that symbol should come before the value (e.g. $ 10) or after (e.g. 10 ₫ which is Vietnamese Dong).
But how the numbers are formatted depends upon the users loca...
I have a .NET 2.0 website that is periodically losing the value for the DateTimeFormatInfo.CurrentInfo.AMDesignator (or PMDesignator) property. This causes code such as Now.ToString() or even Now.ToString("dd/MM/yyyy hh:mm tt") to not properly display the AM/PM designation which then causes date validation to fail. This issue happens sp...
When I save a workflow XAML file with assembly references, they will be saved with the strong named reference that include the version number. When I upgrade the application assembly that the XAML file references, the XAML file is no longer valid and cannot open because it says that it's missing the assembly I updated. How do I fix thi...
I've been following/using Mono for a while for .NET development in Linux. After reading about this recent controversy and the link this article provides to DotGNU Portable .NET I wanted to know your experiences with both implementations, and what the palpable diferences between these two projects are. For instance, I had no idea that ...
I have Office 2007 on my dev machine. I have a small app I'm building for a customer server with Office 2003 that needs to do some interop. My program will run as a scheduled task in a nightly batch process.
No matter what I do, I can't find the version 11.0 of the Access interop assembly so that will work on the server.
I've tried...
I have 2 dropdownlists on my aspx page, second is filtered by the selection in the first list.
How do I pre-select the two dropdown lists with the data saved in the database for the record when the page loads, it does not work when I bind data on the page on Page_Load.
I am using ObjectDataSource to bind the two dropdownlists.
<asp:Dr...
I want to use bindingredirect attribute to redirect old version of assembly to latest release version, Is it possible or I have to change newversion value each time when I make a new release?
...
Hello,
I've got a process which attempts to decode different encodings of strings from a binary stream. I get some behavior which does not quite add up in my mind when I step through it. Specifically, what I do is:
obtain the maximum number of bytes which would be used to encode a character in the given encoding
grab the amount of b...
My question is regarding a code sample from this MSDN article:
Getting Started (LINQ to SQL)
The following code is listed in the article:
// Northwnd inherits from System.Data.Linq.DataContext.
Northwnd nw = new Northwnd(@"northwnd.mdf");
var companyNameQuery =
from cust in nw.Customers
where cust.City == "London"
select...
Does a application in .NET need to be built in 64 bit to take full advantage of a machine with a 64 bit OS on it, or will it take advantage of it just as a 32 bit build. Basically, we have an issue with an out of memory exception and it was suggested to run the console app on a 64 bit box which "may" solve the issue. The question is can ...
When using calling the SqlCommand.ExecuteReader() method, ReSharper tells me I have a possible NullReference exception when I use the SqlDataReader object afterwards.
So with the following code:
using (SqlConnection connection = GetConnection())
{
using (SqlCommand cmd = connection.CreateCommand())
{
cmd.CommandText = ;...
I have a multi-project ASP.NET + C# solution. Tonight, I was planning on writing a quick (separate) VB app that yanks out all DLLs, ASPX, Config, etc files and slaps them into a 7zip file for deployment to the test server.
Is there a more elegant solution than this?
My development environment is VWD2008Express.
Thanks in advance for y...
The following code fails on the pre condition. Is this a bug in code contracts?
static class Program
{
static void Main()
{
foreach (var s in Test(3))
{
Console.WriteLine(s);
}
}
static IEnumerable<int>Test (int i)
{
Contract.Requires(i > 0);
for (int j = 0; j < i;...
I've been developing Windows Forms/Windows services/webservices for most of my career using VB (before .NET), then strictly C# since it was released. Now, I've recently lost my job and starting to think I may not be able to get a job in my town - Las Vegas. I'd like to be able to apply for some of the Java jobs to increase my chance of...
I have looked at a few of the well-known AOP-oriented frameworks for .Net such as PostSharp, bltoolkit, Castle, Cecil, and Policy Injection Block from Microsoft. Perhaps I am ignorant, but it appears that these frameworks do not provide the ability to inject code while the class is being loaded by the virtual machine, before it is visib...