I have a question related to MDF file that store out data in. Actually I'm a newbie in ASP and I found a project that has ASP.NET plus C# so I want to start that file so placed all the file in C:inetpubwwwroot. There is a folder that call App_Data and has a database file end with .MDF Now how can I open this file to see the whole tables? I have Microsoft server 2008 Developer and I have VS 2008 and how can I start my ASP page with database loaded?
What is the right approach when users (authenticated domain admins) should be able to start batch jobs (usually exe files) from an IIS (7.x) aspx (c#) page? This is an intranet site. The batch jobs have to run on the web server as Domain Admins. The website pool is executed by network service or some similar restricted account in AD.
Approaches I can think of (and their disadvantages): 1. Start exe file with System.Diagnostics.Process.Start with another account. This feature is disabled in IIS 7.x, how do I allow it?
2. Create a sheduled task and call scheduled task-api. This unmanaged dll is giving VS compiler warnings because it's unsafe to call from managed code.
3. I suppose there's a better approach, because the previous suggestions doesn't appear safe or robust.
I can't see it nowhere in Visual Studio's Solution Explorer. The tutorial that I am following is using the Northwind database and hence the need to add the code line "using NorthWindTableAdatpter;" statement.So I thought I needed to add "using myDBTableAdapters" statement in my code which I did, but it's giving an error saying:
"The type or namespace name 'myDbTableAdapters' could not be found (are you missing a using directive or an assembly reference?)"
What's wrong? Where is the class for myDB's table adapter? I searched the .xsd file, but there's no mention of "myDBTableAdapters".It's not there in the Solution Explorer.
So i am developing app according to official asp.net tutorials DAL Tutorial.So i created dataset connected to filebased sql database where are tables VIDEO, GENRE, LOAN! VIDEO has FK to GENRE and LOAN has FK to VIDEO! I tried to create method GetVideoByLoan with this sql command:
SELECT VIDEO.ID_VIDEO, VIDEO.TITLE, VIDEO.DIRECTOR, VIDEO.YEAR, GENRE.TITLE AS GENRE_TITLE FROM VIDEO INNER JOIN GENRE ON VIDEO.ID_GENRE = GENRE.ID_GENRE INNER JOIN LOAN ON VIDEO.ID_VIDEO = LOAN.ID_VIDEO WHERE (LOAN.USERID = @USERID OR @USERID = cast(cast(0 as binary) as uniqueidentifier) AND(LOAN.ISLOAN = @ISLOAN)
Everything is ok, no problem to return the results, but when i try this sql:
SELECT LOAN.ID_LOAN, LOAN.USERID, LOAN.ID_VIDEO, VIDEO.TITLE, VIDEO.DIRECTOR, VIDEO.YEAR, GENRE.TITLE AS GENRE_TITLE[code]...
i get error.Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.
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.ConstraintException: Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.
If i run above sql command in query editor everything is fine, but when i try to access it through dataset the above error apperas, despite that first sql was working. I also tried to remove VIDEO DataTable from DataSet and drop it there from server explorer again but it not helped.
I am working on asp.net 3.5 through C#, I have 1 problem regarding File Upload. We are using Master Page. How to upload file on Other Machine connected in LAN
when a website is entered in a browser it should take to a login page (in localhost) and if the login succeed then the site should be loaded else an error page should be displayed. the login page will be connected to local database. how to do this?
Ive created a web site using VS2008 ASP.net and connected to a Firebird Database.
I have a page that has a GridView(added at design time) and have connected to a table at runtime.
[Code]....
All good as the table contents are displayed at 10 rows per page. Ive set the Property AllowSorting to True. Has anyone got examples on how to code the sorting? Ive had a look round the net but all the examples Ive tried dont work.
This block of code display Download file Dialog for Open or Save the attached file.It's working fine in Mozila Firefox and IE8 but doesn't display Download file Dialog box in IE 7
I am working on asp.net 3.5 in C#. In my application I have to Create folder and upload file in that folder, which works fine on my machine. I want help for create folder and upload file in that folder on other machine which is connected in LAN. code for create folder and Upload file on my machine
2. I have PC, on which file to copy to device is located, with Active Sync installed and IE running which has a page in that IE has rendered by server #1.
3. I have a DEVICE connected to desktop #2 via AS.
I would like to copy file from a local machine to the device which is connected to this machine. My application is located in a webserver.
I have a folder called GUI. Inside GUI thers another folder called PDF and inside this folder, there are some PDF files. This folder (GUI) is uploaded to the server too. Then I have a WebForm with some ImageButtons. When I click one of these ImageButtons, I want the file to open in a new tab. I tried with the following code:
[Code]....
As you can see, I build the path using the tooltips of the different ImageButtons. The ToolTip = File Name I want to open. When I try this in debug mode, it works. It opens the pdf file in a new tab. However when I publish my website and upload it to the server... it doesn't work... when I click an ImageButton I get the following exception: No application is associated with the specified file for this operation
Description: An unhandled exception occurred during the execution of the current web request. review the stack trace for more information about the error and where it originated in the code. Exception Details: System.ComponentModel.Win32Exception: No application is associated with the specified file for this operation Source Error:
[Code]....
Stack Trace:
[Code]....
[Win32Exception (0x80004005): No application is associated with the specified file for this operation] LandingSite.LnkRelease1_Click(Object sender, EventArgs e) +215 System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e) +108 System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +118 System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565 Version Information: Microsoft .NET Framework Version:2.0.50727.3607; ASP.NET Version:2.0.50727.3082
I need to call a console application to load data into another desktop application on the remote server that located within the corporate domain.
Users will enter the web page and upload data to asp.net web server, which after transformation should call that console application. Users are located remotely and do not have any other access except the web server.
I decided to lower the security web application context and let the asp.net working process to start the console application on the current IIS 6.0 web server
What I have done:
I changed the security account for the application pool for Local System;
I added ASPNET Account and IIS_WPG IIS Process Account to Administrators group;
I added "Allow service to interact with desctop" for "IIS Admin Service" and "World Wide Web Publishing Service" processes and restarted the machine;
I tried to start BAT-file at server side through the test page code-behind, but failed:
In my application I am building a zip file for the User to download for some exported database information. The zip file is created when the user clicks a "generate data" button and I log the request in the database.
On my page, I have a Gridview which shows the download history of the User and also offers them the ability to download the latest generated file for a set period of time.
The issue I'm having is when they click the button, I'd like the page to refresh (thus refreshing the gridview and showing their latest request) and then start the file download for them (IE, bring up the prompt and let them decide whether to open/save/cancel it).
I'm able to start the download on a post back, but my Gridview is not updating before it begins so it doesn't show the newest request in the list. How can I get the gridview to update BEFORE the download prompt starts?
I'm using the following to start the download:
public void BeginDownload() { FileDownload download = InventoryService.GetLastThreeFileDownloads(this.EmployeeId).First(); FileInfo fi = new FileInfo(Server.MapPath(SERVER_DOWNLOAD_PATH) + download.DownloadFileName); Response.Clear(); Response.ContentType = "application/zip"; Response.AppendHeader("Content-Disposition", "attachment; filename=" + fi.Name); Response.TransmitFile(fi.FullName); Response.Flush(); }
The method is called in the Page_Load event as the last item, if a hidden field is set to true (which I set when they click the button to build the file).
I've also tried doing this through jQuery / AJAX calls to either refresh the page and start the download with little success. I have thought about opening a modal dialog and letting them click a link to start the download and then refresh the page when the modal closes, but that's a last resort if I can't find another solution.
i am using a data list with link button in it that is dynamically populated by String list. i can get accurate path of the clicked link button from the data list, and the next step is to open that document. i am using process.start() method to open pdf file but it does not open that file.i am using the following code to open pdf file from specific path. Code: protected void lnkbtnFirstQtrly_Click(object sender, EventArgs e) { try { //dirCustom is the DirectoryInfo variable that is global variable.
I want to start a new thread to query a database while my web application continues running. I was under the impression that by using threads I can run the querying process independently while the normal web application page cycle carries on, but I could be wrong.
public class DbAsyncQuery { Dictionary<string, object> serviceResults = new Dictionary<string, object>(); public void UpdateBillingDB() { QueryAllServices(); foreach (KeyValuePair<string, object> p in serviceResults) { IEnumerable results = (IEnumerable)p.Value; IEnumerable<object> sessions = results.Cast<object>(); DbUtil.MakeBillingDBEntry(sessions, p.Key); } } public static string[] servicesToQuery = new string[] // Must go in config file ultimately { "xxx.x.xxx.xx" }; public delegate void Worker(); private Thread worker; public void InitializeThread(Worker wrk) { worker = new Thread(new ThreadStart(wrk)); worker.Start(); } public void InitializeQuery() { Worker worker = QueryAllServices; InitializeThread(worker); } private void QueryAllServices() { Dictionary<string, DateTime> lastEntries = DbUtil.GetLastEntries(); foreach (string ip in servicesToQuery) { string fullServicePath = "http://" + ip + ":800/MyWebService.asmx"; //object[] lastEntry = new object[] { lastEntries[ip] }; object[] lastEntry = new object[] { new DateTime(2011, 1, 1, 0, 0, 0) }; object obj = WebServiceHandler.CallWebService (fullServicePath, "MyWebService", "GetBillingDBEntries", lastEntry); serviceResults.Add(ip, obj); } } }
It seems to basically stall and wait to finish the query before loading the page (which can be thousands of rows, so it takes awhile). I put this in the following section of Global.asax:
This is one of my first web pages, and I'm new to threading. I understand there is a difference between creating your own thread and using the ThreadPool. In this method, I am using my own thread, I think. Not sure if that's the best way. The querying process can be completely independent, and its only going to occur on scheduled intervals (every 8 hours or so). The user doesn't need to have up to the minute data, so it can take awhile. I just don't want the site to wait for it to finish, if that's possible.
I am trying to register the route collection in .net based on each session. The code I have works fine, you goto website/username and it loads the correct sub pages, but you have to restart the application to goto website/username2 to load those sub pages. But when the application is restarted the second one works, but then not the first one. Is there some way to create a different route collection per session not per application using system.web.routing.
So, I have a webForm that has an ImageButton. This ImageButton has to open a file (said file is uploaded by the user in another web form. The file is saved to \serverNamefiles; it can be a doc file, pdf file, excel file).
So this ImageButton should open said file as you normally would. It works on debug, however when I publish my site, and run it from my localhost, it doesn't open the file. When I click the ImageButton it just does the postback and nothing happens.
The code for the ImageButton is just:
Process.Start(fileName);
fileName has the full path of the file I want to open, in this case it has: \serverNamefilesmyFile.pdf
While writing to the SQL Server database, I might encounter the below error message: "Error 823I/O error <error> detected during <operation> at offset <offset> in file '<file>'"This error message may occur every time when I start SQL Server and access the MDF file.
i have the code for asynchronous call to the database. i execute the sql command into the begin method that will executed onto the separate thread. now i want to execute the another database call asynchronously so that this also execute onto the separate thread. code for one database cal is here....
I'm trying to debug an ASP.NET webapp that's configured to "Use Local IIS Web Server" on WinXP. When I start the debugger, the compile succeeds, and then the following error is displayed in a dialog:
Unable to start debugging on the web server. The COM+ registry database detected a system error
The webapp never launches in my browser. How can I get rid of this message and debug this webapp?