.net

Manipulating config file dynamically.

Is it possible to change the contents of web.config at run time? ...

SQL Server Timeout after 10 Seconds

We are using OleDbConnection in a C# legacy application to connecto to a SQL Server 2000 where the connect string contains "Connect Timeout=5;" and we have the CommandTimeout set to 30 seconds. Yet when we run a command (a few inserts in a transaction) when the server is slow the query times out after only 10 seconds. System.Data.S...

Inserting in Excel sheet from another Excel sheet

I am trying to read one excel sheet and then creating another excel sheet through OleDb In this another excel sheet, I made some colums like Name char(10), Age Number now when I reading that excel sheet and trying to insert the values in this another excel sheet then values are inserting but also contains one extra char i.e single quot...

JScript.NET Design IDE

I'm currently using JScript.NET for a small UI application. The problem is that my Visual Studio Express doesn't support JScript.NET for designing the UI. Is there a free IDE that I can use to design my UI and produce valid JScript.NET code? I just need the IDE Design functionality to Design the application, that's it. Currently what I...

CookieContainer handling of paths (Who ate my cookie?)

Hi, I'm working on a project that involves some basic web crawling. I've been using HttpWebRequest and HttpWebResponse quite successfully. For cookie handling I just have one CookieContainer that I assign to HttpWebRequest.CookieContainer each time. I automatically gets populated with the new cookies each time and requires no additional...

Webservice to display products

Hi, Im building a small webshop in .net .The webshop solution will contain several "webshops" that use the same server. My question is this: When i have a product menu and product listing. Will there be any performence problems with using jQuerey Ajax calls to get the selected product/products? There will be many calls to the same webse...

Display heirarchical data C#

I am relatively new to programming so be gentle... I am trying to develop a page to display student/class results by subject/teacher. Some classes have groups which contain students and some have only students. A subject is thought by one or more teachers. This may change in the future and I want to keep the design as flexible as pos...

Windows Service without [RunInstaller]

I wrote a Windows Service using C#.NET. To install the service, I've added a "Project Installer" class that inherited from the Installer class and decorated with the [RunInstaller]. Without the [RunInstaller] decoration, I cannot install the service using installutil. Why is it that by deploying the service using the ServiceInstall tab...

.NET MVC Timed Events & Temporary Data Storage

Hi all, I'm relatively new to .NET MVC (c#) development. I'm aiming to code up a simple timed quiz, which extracts a numerical value from the database, sets an individual timer for each user doing the quiz (using aforementioned extracted value), and then loads a set of questions from the database - (I'm not concerned with the data extr...

System.Data.SqlClient.SqlException: Invalid object name 'MESSAGE'.

hello all, i have encounter a error that's what can i do? System.Data.SqlClient.SqlException: Invalid object name 'MESSAGE'. ...

Weird behavior of conditional operator?

string sortedcolumn = ( dataGridView1.SortedColumn != null ? dataGridView1.SortedColumn.Name : "username" ); In above statment when dataGridView1.SortedColumn==null I get exception of dataGridView1.SortedColumn is null instead of getting value as "username" to sortedcolumn var. Any idea? ...

Capturing Inline Expression Result

What I need to do is capture the result of an expression within an MVC view (sample below). I have also provided a stub Processor demonstrating what I want to achieve. Basically I want to divert the Target of the Action into some arbitrary string buffer that I can manipulate later. However the Target property is readonly. Can this ...

Read and edit .cdb files (Pocket Access) in C#

I need to make a program that can read and edit certain .cdb files (Microsoft Pocket Accesss files, created and used by legacy accounting mobile application). I'd like to do that in C#, using VS2008. It would be great to be able to create both a desktop application (.Net) and a mobile application (.Net CF), but just one of them is perfe...

Refresh CollectionViewSource (Entity Framework) bound control

I can't believe I can't find an answer to this... I've created Entity Framework models generated from DB (SQL Server CE) I dragged an Entity from Data Sources to my MainWindow, automagically creating this XAML: <Window.Resources> <CollectionViewSource x:Key="contentItemsViewSource" d:DesignSource="{d:DesignInstance my:ContentItem, Cre...

Best logic to select/restrict correct date from range - .net

Hi, Apologies for using someone else's brain for this, but I'm sure this is a common problem and has some sort of design pattern solution that I've not come across before. I have an IList of objects that each have a "start" and a "stop" date. These date ranges can overlap. What I need to do is select which object is current for today's...

WPF Listview Columnheader Click Event

I have a ListView (GridView) in WPF and I'm trying to implement sorting according to http://msdn.microsoft.com/en-us/library/ms745786.aspx. In my case, the celltemplate for one of the columns contains an Expander. Now when I click the expander header, the GridViewColumnHeader.Click event fires. How do I prevent this from happening? ...

How to create a custom .NET base class library (BCL) aka mscorlib replacement?

Does anybody know how to make a custom BCL work with the stock CLR? How to discover existing the most essential ties between CLR and BCL and reuse them? Here is what I have so far: http://lightnet.codeplex.com ...

How do I return an IQueryable from Linq to SQL query when the dbContext is with a 'using' block?

I've been coding with 'using' blocks but I am wondering if I can return an IQueryable from the following without the object being disposed before I access it. public IQueryable<Contact> GetContacts(string clientID) { using (dbDataContext db = new dbDataContext()) { var contacts = from _contacts in db.Contacts ...

C# generics - possible to create a method with n Generic types..?

I don't think this is possible but here goes... I want to add method that can handle n numer of generics. for example : bool<T> MyMethod() where T: Isomething { } will work for one type bool<T,K> MyMethod() where T: Isomething { } will work for two types Is there a way to work with n types - e.g. bool<T[]> MyMethod() where T: ...

WSDL.exe - generate interface as well as concrete class for easy fake/mocks later.

Is it possible to get WSDL.exe to generate interfaces as well as, or instead of, concrete classes when it generates proxys to a web service? We're consuming a 3rd party webservice from an ASP.Net application, and have generated our proxy classes using WSDL.exe all well and good. I now want to write tests against my wrapper and business...