In ADO I can create a DataSet without actually querying a database : I can instantiate a DataSet and fillit with my own data. I would like to be able to do the same with a multidimensional object, so that anything that can query an OLAP cube (eg Excel) can consume the data my application produces, without having to populate a database. H...
I am using LINQ to SQL classes, and have extended one (with a partial class) and added an extra property. I want to query on this property, so:
(from p in db.TableName where p.CustomProperty=="value" select p)
However this doesn't work. I get an error: The member 'TableName.CustomProperty' has no supported translation to SQL. At the...
It's always hard for me to understandably (especially in English which isn't my first language) explain, what my problem is, so I'm sorry in advance for intricacy or excessive triviality ;).
What I need to do is to 'parse' Word XML document in a specific way. The document converted to xml has some parts that will be put between some fix...
I'm embarking on a C# project where certain tasks will be divvied up and run on multiple threads. I'm looking for as many good tools as possible to help make sure I'm running as efficiently as possible. So I want to watch for things like resource (CPU) usage, blocking, deadlocks, threads that are waiting for work, and so on. I want to...
We have encountered an unexpected performance issue when traversing directories looking for files using a wildcard pattern.
We have 180 folders each containing 10,000 files. A command line search using dir <pattern> /s completes almost instantly (<0.25 second). However, from our application the same search takes between 3-4 seconds.
We...
I have a strange problem with a Windows Forms event. To be exact, it's a KryptonHeaderGroup's ButtonSpec Click event, but it also happens with a plain vanilla System.Windows.Forms.Button.
In the click event, the user interface is brought down (there's a label and a cancel button left), and then an expensive LINQ query is built from prev...
I'm writing an XSD schema which has an element that describes a file structure:
<xs:schema
...
>
<xs:element name="FileStructure">
<xs:complexType>
<xs:sequence>
<xs:element ref="Folder" minOccurs="1" maxOccurs="1" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Folder">
<xs:...
Hey everyone,
I've been working with C# for over a year now, and I was wondering what other functionality the tag attribute has of a control, till now each .net control I've used (buttons, labels, textboxes, gridview, etc.) have a tag attribute that you can define.
I only know you can put something in it like a string of text.
The vis...
Hi, as the title says, I'm looking for an event to catch after a user control has been shown.
At the moment, I have to set a do-once variable and catch the Invalidated event.
...
Hi there,
I have a piece of code where in there are 2 overloads which differ by data types of parameter and have different number of parameters as well. I am looking to reduce the code duplication. What are the possible ways I can do this?
My code looks like this:
public void publicMethod(double[,] data, double increment)
{
...
Hi
My function returns some long value
which contains two values in lower and higher 32 bits.
I thought the best ways to handle return value
is to derive my custom type from long and provide
type extenders like GetLowerValue(), GetHigherValue().
The problem is that .NET does not allow to derive from long
If you compile that
public c...
Is there a way to draw an emf metafile (exported form a drawing tool) with antialiasing enabled? The tools I tried are not capable of exporting emf files antaliased so I wondered if I can turn it back on manually when drawing the emf in the OnPaint override of my Controls.
If anyone can confirm that is technically possible to generate ...
I have a situation where a vendor-supplied assembly reference is messed up. Basically, it is pointing to a version of the assembly that I do not want to use. I used FusionLog to view the assembly binding log and I see these entries:
LOG: Publisher policy file is found at C:\WINDOWS\assembly\GAC_MSIL\policy.11.0.iAnywhere.Data.SQLAnywh...
Here is the code
Stream stream = request.InputStream;
String xsd = // Path to file
XmlReaderSettings settings = new XmlReaderSettings();
if (xsd.Length != 0 && File.Exists(xsd))
{
settings.ProhibitDtd = false;
settings.Schemas.Add("", xsd);
settings.ValidationType = ValidationType.Schema;
}
else
{
throw new cXMLException("XSD ...
I have an ActiveX control and have signed it with a test certificate every this is working fine but problem is that My internet explorer shows an ugly message The website wants to run following add-on: 'Not Available' from 'Control name is not available', If you trust the website and the add-on and want to allow it to run, click here.......
I have a dataset with a column "person_code".
This column contains the following data:
"Carra"
"Carra " -> one trailing space
Now if i set the primary key of the dataset to the column "person_code" I'll get the following error:
"These columns don't currently have unique values."
Any way around this? The best I can think of is to a...
I am planning to use the NetTcpBinding for an application that needs to keep a hand-full of clients in sync.
Whenever there is a change of state at the server, all the connected clients must be informed.
However I need the clients to automatically reconnect if there is a network problem, any outstanding callbacks from the server for t...
I am looking for C# code for the compact framework to determine the current size of a
database table (within a SDF file). Table name "LogTable"
Does anyone have any code examples to determine how this can be achieved. I cannot use a stored procedure as the code throws an exception as this is not supported :-(
I have tried the code bel...
Hey,
So I have a gridview which lists a bunch of jobs.
On this gridview I have paging enabled, which works fine.
When I hover over the Page Numbers i.e 1,2,3,4,.... the following is displayed
javascript_DoPostBack('C100PlaceHolderGrievew','Page$1')
Now my problem is as follows.
When I click on one of the hyperlinks in this list i g...
I have a controller action that automatically redirects to a new page if the user is already logged in (User.Identity.IsAuthenticated). What is the best way to write a unit test for this scenario to ensure that the redirect takes places?
...