Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
P

paas

@paas
About
Posts
118
Topics
28
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Display Excel File in .aspx Page
    P paas

    Hello, I am trying to display an Excel file in a .aspx page that is opened from the page load event of another .aspx page via a window.open. The HTML of the .aspx page that will display the Excel is as follows...

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ExcelViewer.aspx.cs" Inherits="ExcelViewer"%>

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
    <title>Excel Viewer</title>
    </head>
    <body>
    <form id="form1" runat="server">

    </form>
    

    </body>
    </html>

    The PageLoad event of the code behind the .aspx page that will display the Excel file includes the following code:

       FileInfo fi = new FileInfo(sFilePath);  // sFilePath is path to Excel file...
    
       Response.Clear();
       Response.ClearHeaders();
       Response.ClearContent();
       Response.ContentType = sMIME;  // sMIME stores the mime type
       Response.AddHeader("Content-Disposition", "inline; filename=" + fi.Name);
    
        Response.WriteFile(sFilePath);  
        Response.Flush();
    

    HttpContext.Current.ApplicationInstance.CompleteRequest();
    File.Delete(sFilePath);

    What I am finding is that the first time I try to open the Excel file with this code, I get the 'Internet Explorer cannot display the web page...Diagnose connections problems' error page. Then if I try to view the page shortly thereafter the Excel file comes up in the page just fine. Then if I try to view the page a 3rd time I get the error page again...etc. So every other time the viewing is succeeding. Does anyone have any thoughts as to why this is only succeeding in viewing the Excel file every other time? Edit: I have found that if my Content-Disposition is set to 'attachment', after receiving the 'Open' or 'Save' prompt and selecting 'Open' the file does open correctly every time in Excel. I would still prefer to use a disposition of 'inline' so the user does not have to be prompted each time a file is to be viewed. Thank You.

    ASP.NET csharp html sysadmin help question

  • Content Type Error when trying to access Java Web Server
    P paas

    I am trying to access a Java web service from an ASP.NET application written under Visual Studio 2010. If I just try to retrieve the WSDL using the URL (modified for security) below I receive the error that follows. http://PathToWebService/ServiceName?WSDL

    <error>
    <description>Unable to generate WSDL 1.1 for this service</description>
    <reason>If you wish Axis2 to automatically generate the WSDL 1.1, then please set useOriginalwsdl as false in your services.xml</reason>
    </error>

    If I try to add a service reference for the URL I receive the error at the bottom of this message. Does anyone happen to know what I might be able to try on the ASP.NET end to resolve this issue? Thanks...

    There was an error downloading 'http://PathToWebService/ServiceName'.
    The request failed with the error message:

    --MIMEBoundaryurn_uuid_7831B404AE7996BD4D1329310360131
    Content-Type: application/xop+xml; charset=UTF-8; type="application/soap+xml"
    Content-Transfer-Encoding: binary
    Content-ID: <0.urn:uuid:7831B404AE7996BD4D1329310360132@apache.org>

    <soapenv:Reason xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"><soapenv:Text xml:lang="en-US">The endpoint reference (EPR) for the Operation not found is /ServiceName and the WSA Action = null</soapenv:Text></soapenv:Reason>
    --MIMEBoundaryurn_uuid_7831B404AE7996BD4D1329310360131--
    --.
    Metadata contains a reference that cannot be resolved: 'http://PathToWebService/ServiceName'.
    The content type multipart/related; boundary=MIMEBoundaryurn_uuid_7831B404AE7996BD4D1329310361638; type="application/xop+xml"; start="<0.urn:uuid:7831B404AE7996BD4D1329310361639@apache.org>"; start-info="application/soap+xml"; action="http://www.w3.org/2005/08/addressing/fault" of the response message does not match the content type of the binding (application/soap+xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 1024 bytes of the response were: '--MIMEBoundaryurn_uuid_7831B404AE7996BD4D1329310361638
    Content-Type: application/xop+xml; charset=utf-8; type="application/soap+xml"
    Content-Transfer-Encoding: binary
    Content-ID: <0.urn:uuid:7831B404AE7996BD4D1329310361639@apache.org>

    <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv=&q

    ASP.NET wcf csharp xml help java

  • Horizontal Scrollbar, GridView and Styles
    P paas

    Thanks for the reply. I expect the issue is related to a configuration difference but it is not the resolution as the resolution on the 'failing' PCs is the same as that on the successful PCs. Thanks Again...

    ASP.NET csharp html css asp-net visual-studio

  • Horizontal Scrollbar, GridView and Styles
    P paas

    I am developing a web application in ASP.NET, using Visual Studio 2010 - Framework 4.0, that is to be run under IE 8 only. To establish horizontal scrollbars with the GridView when the contents of a grid will be wider than the established page width (1280), I am placing the grid inside a

    tag that has its style set to style="-ms-overflow-x:scroll;width:100%;". Below is a shorthand/skeleton code example of the HTML being used. The horizontal scrollbar works for most of the users, but some users do not get the scrollbar at all and, therefore, cannot see the entire contents of the grid. They are all using the same browser so I suspect a simple configuration issue but I have not determined the issue. Does anyone know why the scrollbar would not show up in the browser for some users? Thanks...

        ......
    
    ASP.NET csharp html css asp-net visual-studio

  • VS 2005 and Setup and Deployment Project Shortcuts
    P paas

    Yeah, I did sort of work it out. Turns out that, by default, that is apparently automatically how VS 2005 does its setups; and I do not believe there is an override. So instead I used the 'Orca MSI Editor' tool to modify the installer created by VS 2005 to use the shortcut I wanted. If you are unfamiliar with the tool, google for Orca MSI Editor and you will find some downloads. I believe it does come with the Windows Installer SDK, but you can download just that tool if you do not want the entire SDK.

    C# csharp visual-studio adobe sysadmin help

  • decimal value being truncated when exporting data to excel from asp.net c#
    P paas

    Does a value such as 7.01 also get truncated to 7? If not, and 7.01 shows up as 7.01 in Excel, then this is probably just a case of the default number format in Excel being 'General' which will cause values like 7.0, or 7.00, etc., to show up as 7 in Excel.

    C# csharp asp-net

  • MDB opened indication
    P paas

    What I have done in the past, under a similar Access MDB requirement, is try to open the database exclusively, while trapping for the error if another user already has it opened, and then display the warning message if the error occurs. If the 'already opened' error did not occur, I would simply close the connection and then re-open the MDB shared.

    Database csharp tutorial question

  • How to convert an exe into a service
    P paas

    IMO VB6 was only a useless language for people who can not program. In addition, Microsoft's support for VB6 did not end until March or April of 2008, which is significantly less than 7 years ago. And, FWIW, the name of this message board is 'Visual Basic', not 'VB.NET', so there is no real requirement that individuals specify what flavor of VB they are working with when posting their questions. You don't complain when people who are working with .NET do not specify that in the subject of their questions, so maybe you should consider showing the same respect for those who still work with VB6.

    Visual Basic tutorial question

  • Null values vb6 + access97 [modified]
    P paas

    In the design of the Access database table in question, ensure that the field is set to 'Allow Zero Length' and that it is not 'Required'.

    Visual Basic help question

  • MS ACCESS Problem
    P paas

    Did you check Microsoft KB? If not, maybe you have one of their described scenarios: Selected collating sequence not supported by the operating system[^]

    Database help database question

  • GAC problem
    P paas

    Maybe this will help, maybe not... Add Reference

    C# dotnet performance help tutorial

  • GAC problem
    P paas

    Did you change the version number of the "GAC" modified DLL, and then ensure your reference was pointing at the new version?

    C# dotnet performance help tutorial

  • [Message Deleted]
    P paas

    Search the articles on this site for Gantt Chart and you will find enough to get you well on your way. And please avoid using the word "urgent" in any future messages.

    C#

  • Protected Overrides Function ProcessCmdKey
    P paas

    AndyASPVB wrote:

    Also I noticed that won't work because the function is fired twice, which must be because there is two key strokes?...

    Have you tried running the code without stepping through the debugger? I believe ProcessCmdKey may fire twice under this scenario with the first firing showing keyData as the modifier key values summed (e.g., Keys.Control + Keys.ControlKey), and the second firing being, from my code example (Keys.Control + Keys.C). At any rate, I know the sample I gave you works for me with VS 2003 or VS 2005 for capturing modifier key combinations in ProcessCmdKey (whether it be Alt or CTRL with another key). If it really is not working for you, I'm sorry I don't know why. I have not tried this under VS 2008 and, if that is what you are working under, maybe there is some slightly different behavior.

    Visual Basic help question

  • Protected Overrides Function ProcessCmdKey
    P paas

    If you are trying to capture the Ctrl Key plus an alpha char, like 'C', in ProcessCmdKey I believe the following will work:

     If keyData = (Keys.Control + Keys.C) Then
        ' whatever
        Return True
     End If
    

    In this case the keyData parameter is handier than the message parameter.

    Visual Basic help question

  • Microsoft Access and Record Level Locking [modified]
    P paas

    Mycroft Holmes wrote:

    I presume you have jumped MS directly with the problem and got no respose?

    We don't have direct MS support; and their knowledge base (and other groups) has not yet shed any light on what I am seeing. However, I continue to hold out hope that I am missing something painfully obvious that will soon become clear. OTOH, I may just have to travel down another road.

    Mycroft Holmes wrote:

    It's been has 15 yrs since I worked with Access.

    Lucky you. :)

    Database

  • Microsoft Access and Record Level Locking [modified]
    P paas

    Luc Pattyn wrote:

    I would delegate all DB modifications to one specialized thread, and probably give it an input queue

    Thanks for the reply. Delegating all DB modifications to one thread with an input queue is an interesting thought. I'll probably give that a try if I can not figure out why this version of an Access MDB, which is supposed to support record-level locking, does not seem to at least in this multi-threaded app. Unfortunately SQL Server Express is not an option, and a retry loop could get real ugly in this app.

    Database

  • Microsoft Access and Record Level Locking [modified]
    P paas

    Thanks for the reply. FWIW, the earliest versions of Access only supported page locking, but the Access 2003 format, at least in theory, is supposed to support record-level locking. If you happen to have such a version of an Access MDB, under its Tools/Options/Advanced tab you can see that there is an option to open databases using record-level locking. And, in the connection string I am using the parameter "Jet OLEDB:Database Locking Mode=1" is supposed to be for record level locking (Mode=0 would be page locking). I agree that the multi-threading seems to be using page locking, so I am curious if anyone has had any success with Access MDBs under a similar, but certainly not recommended, scenario. Unfortunately using SQL Express is not currently an option on this project; users may have to suffer with slower non-threaded performance if I can't figure something out.

    Database

  • Microsoft Access and Record Level Locking [modified]
    P paas

    I am working with Microsoft Access MDBs (2003 Format) on a project and have a situation where two threads can be inserting records in the same table at the same time. I am using OleDB to open the Access MDB, create commands and transactions, and insert the records. The connection string to open the MDB is essentially the following:

    MyConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Jet OLEDB:Engine Type=5;" & _
    "Jet OLEDB:Database Locking Mode=1;Mode=Share Deny None;Data Source = SOMENAME.MDB"

    Even though I am trying to use record locking with this connection string, and the MDB is certainly shared, we consistently get "Could not update. Currently locked." errors when the two threads are writing to the same table at the same time (and the two threads are using separate OleDBConnections). I have tried using and not using transactions, and the error is the same. Can anyone tell me what else I may need to do to avoid the "Could not update" problem I am experiencing? Thank you...

    modified on Wednesday, April 8, 2009 4:38 PM

    Database

  • ado connection to access mdb file.
    P paas

    If you want to establish an ADO connection to an Access MDB file in .NET, you will need to use COM Interop and start by setting a reference to Microsoft's ActiveX Data Objects library. This comes up often, and I guarantee if you google activex data objects "Com Interop" you will find examples.

    Visual Basic question help database com discussion
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups