I'm using System.IO.File.Create to create a file. I'm not writting to it with a stream writer, just creating it.
I get a server error in the front end when the app trys to open the newly created file - that the file is in use. Garbage collection then seems to come along and a few minutes later all is OK.
Now I know if I was using Streamwriter I would have to close it. Does the same apply to creating?
I've read that opening a stream writer to the file then immediately closing it will fix this.
I have developed an Asp.Net application with backend sqlserver 2008 database. Now i want to install the MSI file in client system along with database file. In client system i want to install the sqlserver with out any sql editor. i.e The sqlserver shouldn't use for development purpose. The sqlserver must acts just like engine between application and database file. In sqlserver which edition i have to install in client system to do the above things ?
I have a web site that you can upload images, the image path is saved in the ImgPath field in the data database and retrieves the image and displays it in the grid view. I want to be able to delete the image from a folder within my project when I delete the record. I'm trying to delete it from the Detailsview_ItemDeleting event.
When I open my ASP.NET site in IIS and try to open the .NET Trust Levels, I get an error message:
.NET Trust Levels There was an error while performing this operation.
Details: Filename: ?C:inetpubwwwrootmyappweb.config Line number: 445
Error: This configuration section cannot be used at this path. This happens when the section is locked at a parent level. Locking is either by default (overrideModeDefault="Deny"),or set explicitly by a location tag with overrideMode="Deny" or the legacy allowOverride="false".
I've checked a few places, but I haven't found anything that seems like it would be locking that setting. Is there a systematic way of determining where that setting is locked?
I create a pdf, then I set NavigateUrl with the path. The file is opened, but if I re-create it, ie open the temp file pdf, don't reload the new.. Only after some minutes (I don't refresh the page) ie re-download the new pdf..How can I force to open always the file on the server?
I have an asp.net application. I want to add a global.asax and global.asax.cs file to my project. In the IDE when I select to create a new global.asax file, the option to create a CS code behind file is greyed out. When the global.asax file is created, no code behind is created, instead code is placed in the global.asax file and the global.asax.cs file is never created? Why is the option for a C# code behind file greyed out?
I think I need something like this after my last line from above:
Col1=first TEXT width 150
My text file has 7 columns, the first row is the header row. The data comes from a Micosoft SQL Server Database where the fields are of the following types:
I have requirement to copy or move file from webserver app folder to local file system folder (user selected). How is it possible in ASP.Net.
On my page i have textbox and browse button and user clicks browse button to select folder and there is Copy/Move button and when clicked the files under webserver folder should be move to the user selected folder. The webserver folder path is available to application.
Just wondering if there is a way to create a file using open filedialogue. I actually need a functioanlity a little bit different from Save Dialog. I have to use OpenFile dialogue because I want user to select file. In addition to this, if the file is not available and user just write a name of the file then it should pop-up like "File not found, would you like to create one?
I would like ask you for some ideas how can I write mechanism that will be automatically read files from folder. I don't know how to schedule the write task. I want to check for new file everyday and if the new file is in the folder read it.
I have an asp.net panel having various controls including gridview. I have converted this panel into pdf and attached it as an email attachment using memory stream. Everything is working fine. Now I have an File upload control outside panel through which I have to attach a file and send it in mail along with the already attached panel. But I am unable to figure out how to do it.
I am downloading file from database using the following code. This code downloads an excel file from the database which has a macro attached to it when it is opened. This macro reads file name of the excel file and uses it for its computation. Everthing works file if user saves the file on his harddisk and then open if but if he directly opens the file from the dialog(by hitting 'Open' button) then file name of the opened excel file comes out be the name of the webform that has the above code and this leads to error in the macro. Is there any option through which i can control the name of the file if user directly opens the file from dialog or the option to disable or remove 'Open' button form the dialog?
Well basically I can't find anything regarding storing an image within a folder on the server, as appose to the SQL database. I have already written code to store the image within my database, but I also need to store the image as a physical entity for CSS purposes, here's a part of my code which can probably be used.
I have this file upload control. I have created a folder name "images" in my visual studio project. I want to upload image into this folder. BUT, when I am uploading a image, system does not show any error. It is uploading the image. But I cannot see it into the "images" folder. But, when I browse the folder from my computer like if I go to c:/my documents/vs project/my project/images. i can see the uploaded image. Then why the image is not visible from my visual studio?? as the image is not visible in my visual studio project, user can not see the uploaded image. my code is as below:
I'm trying to write a text file form my web page, But every time I'm having this error System.IO.IOException: The process cannot access the file '.txt' because it is being used by another process. This is mode code for write file.
I have a .NET 2.0 web application which is running fine in file system. When I configure the same in IIS 6.0, I am getting config errors. Source Error:
Line 6: <system.web> Line 7: <pages> Line 8: <controls> Line 9: <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> Line 10: </controls>
<!-- Set compilation debug="true" to insert debugging symbols into the compiled page. Because this affects performance, set this value to true only during development.-->
<compilation debug="true"> <assemblies> <add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> <add assembly="System.Transactions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> <add assembly="System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> <add assembly="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> <add assembly="System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/> <add assembly="System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/></assemblies> </compilation> <httpHandlers> <remove verb="*" path="*.asmx"/> <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/> </httpHandlers> <httpModules> <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> </httpModules> </system.web> <!--<system.web.extensions> <scripting> <webServices> --><!-- Uncomment this line to customize maxJsonLength and add a custom converter --><!-- --><!-- <jsonSerialization maxJsonLength="500"> <converters> <add name="ConvertMe" type="Acme.SubAcme.ConvertMeTypeConverter"/> </converters> </jsonSerialization> --><!-- --><!-- Uncomment this line to enable the authentication service. Include requireSSL="true" if appropriate. --><!-- --><!-- <authenticationService enabled="true" requireSSL = "true|false"/> --><!-- --><!-- Uncomment these lines to enable the profile service. To allow profile properties to be retrieved and modified in ASP.NET AJAX applications, you need to add each property name to the readAccessProperties and writeAccessProperties attributes. --><!-- --><!-- <profileService enabled="true" readAccessProperties="propertyname1,propertyname2" writeAccessProperties="propertyname1,propertyname2" /> --><!-- </webServices> --><!-- <scriptResourceHandler enableCompression="true" enableCaching="true" /> --><!-- </scripting> </system.web.extensions>--> <!--<system.webServer> <validation validateIntegratedModeConfiguration="false"/> <modules> <add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> </modules> <handlers> <remove name="WebServiceHandlerFactory-Integrated"/> <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> </handlers> </system.webServer>-->
I've just got a new PC set up with windows 7. I mainly do front-end dev, but have done some classic ASP and .NET too. My 'systems admin' skills aren't too good, so I'm looking for advice as to the best way to set up my sites locally.
I built a new asp.net web app just now in Visual Studio 2010 Express, and by default it created a new project in: C:UsersMyNameDocumentsVisual Studio 2010Projects. I then needed to do some work on an old legacy classic ASP site, so I created a new folder in the same 'Projects' directory and loaded my files in there. I then went in to IIS to create this site so I can preview it locally but when I locate the content directory and click 'Test settings...' I get the following authentication error:
"The server is configured to use pass-through authentication with a built-in account to access the specified physical path. However, IIS Manager cannot verify whether the built-in account has access. Make sure that the application pool identity has Read access to the physical path. If this server is joined to a domain, and the application pool identity is NetworkService or LocalSystem, verify that <domain><computer_name>$ has Read access to the physical path. Then test these settings again." Which I don't really understand how to resolve.