asp.net-3.5

How to make per- http Request cache in ASP.NET 3.5

家住魔仙堡 提交于 2019-12-04 23:52:31
We using ASP.NET 3.5 (Controls-based approach) and need to have storage specific for one http request only. Thread-specific cache with keys from session id won't work because threads are supposed to be pooled and therefore I have a chance to have data from some previous request in cache, which is undesirable in my case. I always need to have brand new storage for each request available through whole request. Any ideas how to do it in ASP.NET 3.5? We have used HttpContext.Current.Items collection to do RequestScope caching. It works well. just to clarify what ggonsalv was referring to http:/

Returning a recordset from Oracle to .Net using an Oracle function that takes arguments

删除回忆录丶 提交于 2019-12-04 17:16:19
I currently have the following funciton in an oracle database that returns a concatenated string seperated by pipes. It's a legacy application that is being updated to use .net 3.5. The exiisting application concatenates the returned result set into a VARCHAR2 data type. What I want to do is return the entire result set back to my .net client. The MS SQL equivalent of what I'm trying to accomplish is a simple "SELECT * FROM TBL WHERE id = @id" I'm not use to some of the concepts Oracle uses. I't seems like e blend of OOP and SQL querying. I've read multiple examples on this but can't seem to

Which is a better method for storing images - folder or SQL Server as binary?

烈酒焚心 提交于 2019-12-04 16:55:13
问题 I am planning the development of a photo gallery application for a client. I am developing the app in asp.net 3.5 and would like to develop it so that I can re-use the application across multiple platforms using various front-ends. Basically, I am wondering what are the dis-advantages and advantages of storing images in the database as binary files as opposed to simply storing the files in an application folder. Any advice would be greatly appreciated! Thanks, Tristan 回答1: The disadvantage of

Divide Foreach into threads sample

邮差的信 提交于 2019-12-04 13:07:49
I want to run " SearchResultByOrderNumber(string orderNumber) " method in Foreach with multithreading. There are ten OrderNumbers in OrderNumbers Datatable. While searching these OrderNumbers in OrderResults Datatable, I want to divide these OrderNumbers into five threads. In each thread there will be two search for OrderNumbers. How can I do this threading with Asp.Net 3.5 Framework ? I think, I must renew my question. How can I divide "OrderNumbers" into Async methods automatically? Firstly, I got rowCount . I am going to define Async method count. Then I will get rowsPerAsyncMethods by

Encrypt data in web.config

耗尽温柔 提交于 2019-12-04 11:23:28
I have the following line in my web.config <appSettings> <add key="AdminPassword" value="ASDF1234" /> </appSettings> How can I encrypt it? I tried this tutorial but it got me all confused Help?! See the articles at: http://weblogs.asp.net/scottgu/archive/2006/01/09/434893.aspx 来源: https://stackoverflow.com/questions/785654/encrypt-data-in-web-config

Passing parameters in the Form constructor, winforms c#

∥☆過路亽.° 提交于 2019-12-04 10:13:21
I have a following inheritance hierarchy: Class A : Form Class B : Class A Class A needs to be able to accept a parameter so that I can create the instance of Class B like this: ClassB mynewFrm = new ClassB(param); How do I define such a constructor in Class A? thanks! I am using Winforms in .net 3.5, c# EDITED: Class A and Class B are defined as forms, using partial classes. So I guess this is turning into a question about partial classes and custom (overriden) constructors. Here is a complete demo sample that demostrates required behaviour. For the sake of ease your learning, I chose a

ASP.NET CSS file not loaded when adding HttpModule to web.config

两盒软妹~` 提交于 2019-12-04 06:56:32
问题 i am making a Website with c# and ASP.NET 3.5, i just made an HttpModule to handle the NHibernate Session Life (Open and close). I added it to the web.config and everything works fine. (all the query, code, etc working fine) except that CSS file of my masterpage is not loading !! it's so strange for me, Do you have any idea what is the cause of this behavior ? Thank You all, 回答1: at last i found the solution, the problem source is working with the session in the HttpModule events cause

Do a database query on Textbox onblur event

坚强是说给别人听的谎言 提交于 2019-12-04 05:17:36
I am using asp.net 3.5 with C#. I need to do a database lookup when a user enters ProductID in txtProductID. I guess doing javascript is out of the question since this will have to be server side call. I wrote this code in the page_load event of the webpage: protected void Page_Load(object sender, EventArgs e) { txtProductID.Attributes.Add("onblur", "LookupProduct()"); } protected void LookupProduct() { //Lookup Product information on onBlur event; } I get an error message: Microsoft JScript runtime error: Object expected How can I resolve this ? Use the TextBox.TextChanged event. ASPX markup:

Is it possible to speed this method up?

佐手、 提交于 2019-12-03 19:09:03
问题 I have a method that uses loops through 7,753+ objects and Gets the value of each property for each object. Each object has 14 properties. private void InitializeData(IList objects, PropertyInfo[] props, List<DPV> dataPs, List<Dictionary<string, object>> tod) { foreach (var item in objects) { var kvp = new Dictionary<string, object>(); foreach (var p in props) { var dataPs = dataPs.FirstOrDefault(x => x.Name == p.Name); object returnData; if (dataPoint != null) { int maxLength = (dataP

None of my “code behind” code is being called

穿精又带淫゛_ 提交于 2019-12-03 17:52:35
问题 I have just created an ASP.NET C# project and a virtual directory for it in IIS in (as far as I know) the normal way, but I am seeing very strange behavior that I have never seen before. It seems that none of my C# methods are ever being called. I know this because I have overridden a bunch of methods to do nothing but throw an exception. At least Default.aspx is viewable in the browser (see below) Here is the exact content of my Default.aspx.cs file: using System; using System.Collections