The Problem
Using Link to SQL I would like to filter by columns that I do not want returned in the select statement. This works fine as long as the query is built all at once. In situations where I try and build the where clause dynamically, I get a compile time error because the column is not included in the select.
Example
WORKS...
Is there a way to not fetch a specific column using linqtosql without having to use an anonymous type and specify each returned filed individually?
We use SQLMetal to generate the dbml file which contains all the types into which to put the queried data results. However, when select columns are included in the linq query, the results g...
Basically I want to be able to do this:
session.ExecuteSql("...");
I don't need it to map to any entities or return any values. Any suggestions?
...
I have some code,
int count = 0;
list.ForEach(i => i.SomeFunction(count++));
This seems to not increment count. Is count passed by value here? Is there any difference if I use the {} in the lambda?
int count = 0;
list.ForEach(i =>
{
i.SomeFunction(count++);
});
Update 1
Sorry, my mis...
Hi all,
I've defined the following view:
<CollectionViewSource x:Key="PatientsView" Source="{Binding Source={x:Static Application.Current}, Path=Patients}"/>
Where Patient is the following property:
public IEnumerable<Patient> Patients
{
get
{
return from patient in Database.Patients
orderby patient.Lastname
select p...
I'd like to pass a set of record identifiers into an Oracle procedure, using a comma-separated string. I want to place this into a temp table and then join off that in further processing. How would I go about this?
Better approaches than CSV's would be great to hear about too. I'm using ODP.Net for data access.
...
Dear Friends,
I am developing a .NET/C# 2.0 application which uses the PowerShell SDK for script execution. I am not using SnapIns. I am setting everything directly through PS's RunspaceConfiguration.
So my problem is that I cannot add a custom format for my type Plux.ExtensionTypeInfo implemented in the application.
( Plux.Extensio...
Is there an elegant way to get the method that will be executed on a service instance from MessageInspector/AuthorizationPolicy/some other extension point? I could use
OperationContext.Current.IncomingMessageHeaders.Action
but I hope there's some way to do it without manually matching SOAP actions with OperationContracts.
What I'm...
I'm writing a Windows .NET app that needs a WYSIWYG text editor control that can
display images inline with the text
output the text with it's formatting into HTML, XML or something similar (other than RTF)
preferably free but commercial is fine
...
I'm trying to create a rich text DataGridViewCell. I can host a RichTextBox as the editing control, but when the cell isn't in editing mode I need to paint the rich text myself. I don't want to parse the text - I just need an equivalent of Graphics.DrawString that works with rich text.
...
I'm still new to delegates and I've been playing with the Delegate-based Data Access Layer described in Steven John Metsker's "Design Patterns in C#" book (an excellent read!). It defines the data access delegate like this:
public delegate object BorrowReader(IDataReader reader);
The result of using this is code that looks like one of...
Hello
I have a COM object which I need to access from my .NET Web Service.
I know of the whole STA/MTA thing - so my COM object would be converted to be MTA and have no global state (while not being multi-threaded itself).
If I set this up as a COM+ server, and specify an object pool, does this mean that for each web service thread it...
Hi, I am trying to create a unit test similar to how I would have done one in C# but am struggling with the lambdas in vb.
Bascially I am trying to mock a class and then create a stub and return. In C# I would have done something like;
MockedPersonRepository
.Stub(x => x.Find(id))
.Return(person)
But in visual basic I am t...
I want to be able to create an email message with an attachment, but not send it.
The email should open in Outlook where the user can send himself.
I have been playing around with Mailto: command in order to open a new mail message, however, Outlook client doesn't seem to support adding attachments using the Mailto: command.
I do not w...
What is the best way in .Net to make sure a path as capacity to store a file. I need to makes sure I have room for the file before I download is becasue the source will not allow the file to be downloaded a second time. I have looked at System.IO.DriveInfo but this does not work for UNC paths.
...
Hi,
I have a userControl I'm doing some Painting to, and when the control is moved to the edge of the screen, or moved so that the Vista Taskbar overlaps it, the screen edge/taskbar edge is being drawn to the control, leaving ugly lines over the paintable area of the control.
What is the best way to detect this and call Invalidate on th...
Part of my current work involves using an external web service, for which I have generated client proxy code (using the WSDL.exe tool).
I need to test that the web service correctly handles the absence of mandatory fields. For instance, Surname and Forename are mandatory - if they are absent from the call, then a SOAP fault block should...
For some reason, ldap and directory services does not work when the computer is not joined to the domain. The error messages from .net is domain not available. Anyone know what needs to be done?
the basic...
domainAndUsername = domain + @"\" + username;
entry = new DirectoryEntry(_path, domainAndUsername, pwd);
entry.Authenticatio...
Hello All,
We are running a .NET 2.0 Web Application. One of our clients is experiencing an issue where, when two different users are logged into out application on two different machines and one logs out the other user seems to lose its AuthTicket (none of the content is displayed and the page just looks broken). They must log out an...
I have the following Regex to match all link tags on a page generated from our custom cms
<a\s+((?:(?:\w+\s*=\s*)(?:\w+|"[^"]*"|'[^']*'))*?\s*href\s*=\s*(?<url>\w+|"[^"]*"|'[^']*')(?:(?:\s+\w+\s*=\s*)(?:\w+|"[^"]*"|'[^']*'))*?)>.+?</a>
We are using c# to loop through all matches of this and add an onclick event to each link (for track...