.net

What are the best wat to check file exits or not in webapplication ?

Hello, I have created a web application which is creating and updating the xml file on daily basis. i.e. Creating a xml as currentdate.xml. This have all the records of user's visited i.e IP, refferer, visited page and some more. So the same file updating from multiple users at same time. So what are the best practice to check the fi...

Please solve my query regarding dot net

Hi, I am experienced in dotnet wpf silverlight.. I am presently trying to attend some technical interviews. Can anyone tell me what and all topics i have to cover to complete my technical round successfully? ...

Async Updating of UI when an exception occurs in referenced DLL

Hello All, I have a winapp running with a DLL referenced to it. all the major operations are done in the DLL. I have like 1000 xml files stored in a location which i have to read and store data into another format. From the UI, i click on an import button, the call is passed to the DLL layer which converts one xml after another stored...

Why do this two ListBoxes look different if their properties are identical?

If I make a Visual Studio 2010 WinForms project and let the wizard add Form1. Then I add a ListBox to Form1. Then I add a form with "Project/Add Windows Form", and add a ListBox to that form (Form2). And then change in my "Program.cs" file the line Application.Run(new Form1()); for Application.Run(new Form2());, the ListBox in the Form2 ...

winform localization

If there are hundreds of form and 20-30 projects in the application and during localization the number of .resx files generated will be very high. Is there any way to organize the .resx files and satellite assembly? If I move the .resx file to common assembly then the design time support for previewing the form is lost. Is there any st...

Convert B(C(),D()) to (c,d)=>B(()=>c(),()=>d()) - Generating delegate wrappers from MethodInfos?

Ultimately, I'm looking forward to a reflection based approach to create a delegate wrapper for a method B(C(),D()) - to some what like (c,d)=>B(()=>c(),()=>d()) First question - Given that you've a Methodinfo, what are the considerations to create a delegate type (via reflection) which corresponds to that method signature? Do you hav...

.net testing app

i'm using vs2010's standart unit tests, for example, i want to get all information like used variables with their values, called functions, etc. in readable form, xml forexample. how can i do it? ...

Insert foreign key reference in entity frameowrk 3.5

Hello All: I have 3 tables a. Employee (EmpID (pk), EmpName) b. Department (DepID (pk), DepName) c. EmployeeDepartmentMapping (ID (pk), EmpID(fk), DepID(fk)) When I am inserting new employee, I want to insert correspoding Emp-Dep mappings in the EmployeeDepartmentMapping table using entity framework 3.5. Can any body help/tell me ho...

Why is this code preventing my app from closing?

Make a WinForms application in Visual Studio 2010, .NET 4.0, then make a user control (from Project/Add User Control...) with this code: public partial class UserControl1 : UserControl { private string _SelectedTable; public string SelectedTable { get { return _SelectedTable; } set { _SelectedTable = value; ...

SqlException: Timeout Expired

I have a process where two threads are continuously executing sql queries on the same tables. Is there any chance that one of these two threads gets Timeout error? If so, what is the best practice to avoid this? I am getting following error and resulting is process crash. Timeout expired. The timeout period elapsed prior to completion...

ScatterView and ViewBox is not working as expected

I defined the following layout: <Grid Name="RootGrid" Background="{StaticResource WindowBackground}" > <s:ScatterView Name="RootScatter"> <Viewbox> <s:LibraryContainer Name="RootContainer" Grid.Row="0" ViewingMode="Bar"> <s:LibraryContainer.BarView> <s:BarVi...

SelectionCharOffset not set

Though I select subscript or superscript from RichTextBox , SelectionCharOffset is not changing....any idea? ...

TypeDescriptor doesn't return members from inherited interfaces

my problem is that TypeDescriptor doesn't return members from inherited interfaces, is this how it is supposed to be working ? or is it a bug ? [TestFixture] public class DescriptorTests { [Test] public void Test() { // count = 1 ...

Gridview FooterRow textbox text is null when accessing from code behind

I have a GridView with the following columns <asp:TemplateField HeaderText="Name"> <FooterTemplate> <asp:TextBox ID="txt_Name" runat="server"></asp:TextBox> </FooterTemplate> <ItemTemplate> <asp:Label ID="lbl_name" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "t_Name"...

In Task Parallel Library: How to defer Task.TaskFactory.FromAsync task execution?

I have a method that returns a task like: public static Task<int> SendAsync(this Socket socket, byte[] buffer, int offset, int count) { if (socket == null) throw new ArgumentNullException("socket"); if (buffer == null) throw new ArgumentNullException("buffer"); return Task.Factory.FromAsync<int>( socket.BeginSend(bu...

c# capture printing event

Hi, Is it possible to capture from windows service written in C# event when someone tries to print anything from that machine ? thanks for any help, Bye ...

Environment.FailFast in a web context

Hello, Does a System.Environment.FailFast http://msdn.microsoft.com/en-us/library/ms131100.aspx usage has any sens in a web applications ? It kills a process and I can't figure out how it could be applied in the web context. Thanks for your response. ...

Http Agility Pack - Accessing Siblings?

Using the HTML Agility Pack is great for getting descendants and whole tables etc... but how can you use it in the below situation ...Html Code above... <dl> <dt>Location:</dt> <dd>City, London</dd> <dt style="padding-bottom:10px;">Distance:</dt> <dd style="padding-bottom:10px;">0 miles</dd> <dt>Date Issued:</dt> <dd>26/10/2010</dd> <d...

Jquery to sort gridview columns at client side.

How can I using JQuery sort any column of gridview at client side? Kindly share... ...

When to use Partitioner class?

Can anyone suggest typical scenarios where Partitioner class introduced in .NET 4.0 can/should be used? ...