asp.net-4.0

Crystal Reports for Visual Studio 2010 Error

删除回忆录丶 提交于 2019-11-26 23:03:33
问题 I am trying to run a crystal report from my web application which was built using ASP.NET 4.0 and Visual Studio 2010. I have installed the following from the SAP site (http://www.businessobjects.com/jump/xi/crvs2010/us2_default.asp) 1) SAP Crystal Reports, version for Visual Studio 2010 - Standard EXE installation package which installs the software into the Visual Studio IDE. 2) SAP Crystal Reports runtime engine for .NET Framework 4 (64-bit) I have a page called Reports.aspx in which I have

Datatable to Multidimensional Array

我们两清 提交于 2019-11-26 22:06:26
问题 Is there an easy way to convert a Datatable to a multidimensional string array? Maybe using LINQ ? There's gotta be a better way than manually looping through all the columns/rows... 回答1: Linq is the answer. You can convert a DataTable to IEnumerable using the AsEnumerable method. Then, the ToArray() converts it to an array. var tableEnumerable = DataTableName.AsEnumerable(); tableArray = tableEnumerable.ToArray(); 回答2: yourTable.AsEnumerable().Select(row => row.ItemArray).ToArray() 回答3: try

web service should return json

耗尽温柔 提交于 2019-11-26 21:40:00
问题 I need my web service to return JSON... I have the following code in my .asmx file: namespace Feed { [WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [System.ComponentModel.ToolboxItem(false)] [System.Web.Script.Services.ScriptService] public class searchPerson : System.Web.Services.WebService { [WebMethod] [ScriptMethod(ResponseFormat = ResponseFormat.Json)] public Person GetDave() { Person dave = new Person(); dave.FirstName =

How to fix: Handler “PageHandlerFactory-Integrated” has a bad module “ManagedPipelineHandler” in its module list

喜你入骨 提交于 2019-11-26 21:13:26
I am configuring an MVC 3 project to work on a local install of IIS and came across the following 500 error: Handler "PageHandlerFactory-Integrated" has a bad module "ManagedPipelineHandler" in its module list. It turns out that this is because ASP.Net was not completely installed with IIS even though I checked that box in the "Add Feature" dialog. To fix this, I simply ran the following command at the command prompt %windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -i If I had been on a 32 bit system, it would have looked like the following: %windir%\Microsoft.NET\Framework\v4.0

Could not load file or assembly 'System.Web.WebPages.Razor, Version=2.0.0.0

不羁的心 提交于 2019-11-26 19:40:20
问题 I just upgraded packages in an MVC 3 project (ASP.net 4), and now I am getting the following error message when accessing a page in that project: Server Error in '/MyApplication' Application. Could not load file or assembly 'System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) Description: An unhandled

I need a fast runtime expression parser

坚强是说给别人听的谎言 提交于 2019-11-26 18:37:46
I need to locate a fast, lightweight expression parser. Ideally I want to pass it a list of name/value pairs (e.g. variables) and a string containing the expression to evaluate. All I need back from it is a true/false value. The types of expressions should be along the lines of: varA == "xyz" and varB==123 Basically, just a simple logic engine whose expression is provided at runtime. UPDATE At minimum it needs to support ==, !=, >, >=, <, <= Regarding speed, I expect roughly 5 expressions to be executed per request. We'll see somewhere in the vicinity of 100/requests a second. Our current

asmx web service returning xml instead of json in .net 4.0

感情迁移 提交于 2019-11-26 18:31:59
问题 i have just upgraded a test copy of my site to asp.net 4.0 and have noticed a strange issue that only arises when i upload the site to my server. the site has an asmx web service that returns json, yet when i run the site on my server it returns xml. it as been working fine in asp.net 3.5 for over a year. the webMethod is decorated with the correct attributes... [WebMethod][ScriptMethod(ResponseFormat = ResponseFormat.Json)] public List<LocationRecentChange> RecentChanges() and on my local

Can I develop for .NET Framework 4 in Visual Studio 2008?

别来无恙 提交于 2019-11-26 17:58:40
My ASP.NET application runs in IIS on my web server and uses Microsoft .NET Framework 4 Beta 2. (Its Application Pool is set to .NET Framework version .NET Framework v4.0.21006.) It gives this new error: A potentially dangerous Request.Form value was detected from the client... This is due to a breaking change in .NET 4. To revert to the behavior of the ASP.NET 2.0 request validation feature, I added the following setting in the Web.config file: <httpRuntime requestValidationMode="2.0" /> Now Visual Studio 2008 throws a compile-time error: The 'requestValidationMode' attribute is not declared.

An attempt to attach an auto-named database for file …database1.mdf failed

六眼飞鱼酱① 提交于 2019-11-26 16:38:39
I am getting the following error while debugging my visual studio 2010 website: An attempt to attach an auto-named database for file C:\Users...\Desktop\Dpp2012New\App_Data\dppdatabase.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: An attempt to attach an auto-named database

Check if Cookie Exists

非 Y 不嫁゛ 提交于 2019-11-26 16:11:24
问题 From a quick search on Stack Overflow I saw people suggesting the following way of checking if a cookie exists: HttpContext.Current.Response.Cookies["cookie_name"] != null or (inside a Page class): this.Response.Cookies["cookie_name"] != null However, when I try to use the indexer (or the Cookies.Get method) to retrieve a cookie that does not exist it seems to actually create a 'default' cookie with that name and return that, thus no matter what cookie name I use it never returns null. (and