Guys
I developed a small asp web service app in Visual Studio .NET. To
deploy on another server, I just copied the whole dir as is from my
c:\inetpub\wwwroot to the same dir on destination server, but I get
this error. I'm using excel automation etc:
Compiler Error Message: CS0246: The type or namespace name 'Excel'
could not be found (are you missing a using directive or an assembly
reference?)
Source Error:
Line 110: GC.Collect();
Line 111: /* src excel */
Line 112: Excel.Application srcExcel = new Excel.ApplicationClass();
Line 113: Excel._Workbook srcWb = srcExcel.Workbooks.Open(fName,
Missing.Value, Missing.Value,
Line 114: Missing.Value, Missing.Value, Missing.Value,
Can you tell me what I'm doing wrong? Please help.,
thanks 7 1175
"berkeleydb_user" <pr*********@gmail.com> wrote in message
news:11**********************@i40g2000cwc.googlegr oups.com... Can you tell me what I'm doing wrong? Please help.,
Presumably, Microsoft Office (or, at least, Excel) is installed on your
development box and not your web server...?
Excel is there for sure. I'm trying this on Windows Server 2003.
Actually it was my mistake. I edited the file so I could put without
"codebehind" etc. Now I really copied the whole dir from development to
server but when I click on my submit button, nothing happens, page just
comes back and I see 'Done' at the bottom of browser. whats going on?
thanks
"berkeleydb_user" <pr*********@gmail.com> wrote in message
news:11**********************@i39g2000cwa.googlegr oups.com... Excel is there for sure. I'm trying this on Windows Server 2003.
Excel is not part of Windows Server 2003 - are you absolutely certain you
installed it on your server...?
Actually it was my mistake. I edited the file so I could put without "codebehind" etc. Now I really copied the whole dir from development to server but when I click on my submit button, nothing happens, page just comes back and I see 'Done' at the bottom of browser. whats going on?
Impossible to say without more information...
Thanks for your help Mark. Here is my actual code. Its pretty simple. I
have a field where user uploads an excel file. I have to process that
excel file and save it. The webpage doesn't seem to be doing anything.
I enabled running 'active server pages' on IIS admin. Whole office is
installed on this server.
thanks
Webform1.aspx
=================
<%@ Page aspcompat=true language="c#" Codebehind="WebForm1.aspx.cs"
AutoEventWireup="false" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>WebForm1</title>
<meta content="Microsoft Visual Studio 7.0" name="GENERATOR">
<meta content="C#" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5"
name="vs_targetSchema">
</HEAD>
<body MS_POSITIONING="GridLayout">
<form action="WebForm1.aspx" method="post"
encType="multipart/form-data" runat="server">
<P><asp:label id="uploadLabel" style="Z-INDEX: 101; LEFT: 33px;
POSITION: absolute; TOP: 53px" runat="server" Width="135px"
Font-Bold="True" Font-Names="Arial" Font-Size="Smaller">Upload your bid
file:</asp:label><INPUT id="File1" style="Z-INDEX: 102; LEFT: 185px;
WIDTH: 432px; POSITION: absolute; TOP: 50px; HEIGHT: 22px" type="file"
size="52" name="uploadControl" runat="server">
<asp:button id="uploadButton" style="Z-INDEX: 103; LEFT: 343px;
POSITION: absolute; TOP: 134px" runat="server" Font-Bold="True"
Font-Names="Arial" Text="Upload"></asp:button>
<asp:label id="resultNum" style="Z-INDEX: 104; LEFT: 31px; POSITION:
absolute; TOP: 202px" runat="server" Width="548px" Font-Bold="True"
Font-Names="Arial" Font-Size="X-Small" BackColor="#FFFFC0"
Visible="False">Label</asp:label><asp:table id="tblResults"
style="Z-INDEX: 105; LEFT: 33px; POSITION: absolute; TOP: 231px"
runat="server" Width="332px" Font-Bold="True" Font-Names="Arial"
Font-Size="X-Small" BackColor="InactiveCaptionText" Visible="False"
CellPadding="0" CellSpacing="0" BorderColor="Black" BorderStyle="Solid"
BorderWidth="1px" Height="24px"></asp:table><asp:label id="lblVendor"
style="Z-INDEX: 106; LEFT: 31px; POSITION: absolute; TOP: 174px"
runat="server" Width="275px" Font-Bold="True" Font-Names="Arial"
Font-Size="Smaller" BackColor="#FFFFC0"
Visible="False">Label</asp:label><asp:image id="imgChart"
style="Z-INDEX: 107; LEFT: 401px; POSITION: absolute; TOP: 237px"
runat="server" Width="552px" Visible="False"
Height="432px"></asp:image><asp:label id="lblPasswd" style="Z-INDEX:
108; LEFT: 34px; POSITION: absolute; TOP: 99px" runat="server"
Width="84px" Font-Bold="True" Font-Names="Arial"
Font-Size="Smaller">Password:</asp:label><asp:textbox id="txtPassword"
style="Z-INDEX: 109; LEFT: 186px; POSITION: absolute; TOP: 91px"
runat="server" MaxLength="10"
TextMode="Password"></asp:textbox><asp:requiredfieldvalidator
id="RequiredFieldValidator1" style="Z-INDEX: 110; LEFT: 357px;
POSITION: absolute; TOP: 94px" runat="server"
ControlToValidate="txtPassword" ErrorMessage="Password cannot be
empty"></asp:requiredfieldvalidator><asp:requiredfieldvalid ator
id="RequiredFieldValidator2" style="Z-INDEX: 111; LEFT: 635px;
POSITION: absolute; TOP: 52px" runat="server" ControlToValidate="File1"
ErrorMessage="Please specify your excel bid
file"></asp:requiredfieldvalidator></P>
</form>
</body>
</HTML>
here is my webform1.aspx.cs file
=========================
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Data.OleDb;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Reflection;
using System.Runtime.InteropServices;
/// <summary>
/// Summary description for WebForm1.
/// </summary>
public class WebForm1 : System.Web.UI.Page
{
protected System.Web.UI.WebControls.Label uploadLabel;
protected System.Web.UI.HtmlControls.HtmlInputFile File1;
protected System.Web.UI.WebControls.Label resultNum;
protected System.Web.UI.WebControls.Table tblResults;
protected System.Web.UI.WebControls.Label lblVendor;
protected System.Web.UI.WebControls.Image imgChart;
protected System.Web.UI.WebControls.Label lblPasswd;
protected System.Web.UI.WebControls.TextBox txtPassword;
protected System.Web.UI.WebControls.RequiredFieldValidator
RequiredFieldValidator1;
protected System.Web.UI.WebControls.RequiredFieldValidator
RequiredFieldValidator2;
protected System.Web.UI.WebControls.Button uploadButton;
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
resultNum.visible = true;
resultNum.text = "visible";
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.uploadButton.Click += new
System.EventHandler(this.uploadButton_Click);
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
private void uploadButton_Click(object sender, System.EventArgs e)
{
if ( File1 != null )
{
resultNum.text = "file field is not
blank";
}
}
}
I just verified that msexcl40.dll is there in c:\windows\system32.
tthanks
Hi Mark
I made up this small app from a working app. This one does same thing.
It just returns the same page back without doing anything. I select a
file from my c: on server, and click upload. I expect 'resultNum' field
to be visible and show some text. it doesn't. the page just comes back
as it is :((
here is the code:
=============
<% @Page Language="C#" %>
<html>
<head>
<title>File upload in ASP.NET</title>
</head>
<body bgcolor="#ffffff" style="font:8pt verdana;">
<script language="C#" runat="server">
void uploadButton_Click(object sender, System.EventArgs e)
{
resultNum.Visible = true;
if ( File1 != null ) {
resultNum.Text = "abcd";
}
else {
resultNum.Text = "efgh";
}
}
</script>
<form action="apacx.aspx" method="post" enctype="multipart/form-data"
runat="server">
<P><asp:label id="uploadLabel" style="Z-INDEX: 101; LEFT: 33px;
POSITION: absolute; TOP: 53px" runat="server" Width="135px"
Font-Bold="True" Font-Names="Arial" Font-Size="Smaller">Upload your bid
file:</asp:label><INPUT id="File1" style="Z-INDEX: 102; LEFT: 185px;
WIDTH: 432px; POSITION: absolute; TOP: 50px; HEIGHT: 22px" type="file"
size="52" name="uploadControl" runat="server">
<asp:button id="uploadButton" style="Z-INDEX: 103; LEFT: 343px;
POSITION: absolute; TOP: 134px" runat="server" Font-Bold="True"
Font-Names="Arial" Text="Upload"></asp:button>
<asp:label id="resultNum" style="Z-INDEX: 104; LEFT: 31px; POSITION:
absolute; TOP: 202px" runat="server" Width="548px" Font-Bold="True"
Font-Names="Arial" Font-Size="X-Small" BackColor="#FFFFC0"
Visible="False">Label</asp:label><asp:table id="tblResults"
style="Z-INDEX: 105; LEFT: 33px; POSITION: absolute; TOP: 231px"
runat="server" Width="332px" Font-Bold="True" Font-Names="Arial"
Font-Size="X-Small" BackColor="InactiveCaptionText" Visible="False"
CellPadding="0" CellSpacing="0" BorderColor="Black" BorderStyle="Solid"
BorderWidth="1px" Height="24px"></asp:table><asp:label id="lblVendor"
style="Z-INDEX: 106; LEFT: 31px; POSITION: absolute; TOP: 174px"
runat="server" Width="275px" Font-Bold="True" Font-Names="Arial"
Font-Size="Smaller" BackColor="#FFFFC0"
Visible="False">Label</asp:label><asp:image id="imgChart"
style="Z-INDEX: 107; LEFT: 401px; POSITION: absolute; TOP: 237px"
runat="server" Width="552px" Visible="False"
Height="432px"></asp:image><asp:label id="lblPasswd" style="Z-INDEX:
108; LEFT: 34px; POSITION: absolute; TOP: 99px" runat="server"
Width="84px" Font-Bold="True" Font-Names="Arial"
Font-Size="Smaller">Password:</asp:label><asp:textbox id="txtPassword"
style="Z-INDEX: 109; LEFT: 186px; POSITION: absolute; TOP: 91px"
runat="server" MaxLength="10"
TextMode="Password"></asp:textbox><asp:requiredfieldvalidator
id="RequiredFieldValidator1" style="Z-INDEX: 110; LEFT: 357px;
POSITION: absolute; TOP: 94px" runat="server"
ControlToValidate="txtPassword" ErrorMessage="Password cannot be
empty"></asp:requiredfieldvalidator><asp:requiredfieldvalid ator
id="RequiredFieldValidator2" style="Z-INDEX: 111; LEFT: 635px;
POSITION: absolute; TOP: 52px" runat="server" ControlToValidate="File1"
ErrorMessage="Please specify your excel bid
file"></asp:requiredfieldvalidator></P>
</form>
<span id=txtOutput style="font: 8pt verdana;" runat="server" />
</body>
</html>
here is working code for uploading a file. this one works on same
server.
==============================
<% @Page Language="C#" %>
<html>
<head>
<title>File upload in ASP.NET</title>
</head>
<body bgcolor="#ffffff" style="font:8pt verdana;">
<script language="C#" runat="server">
void btnUploadTheFile_Click(object Source, EventArgs evArgs)
{
string strFileNameOnServer = txtServername.Value;
string strBaseLocation = "d:\\downloads\\temp\\";
if ("" == strFileNameOnServer)
{
txtOutput.InnerHtml = "Error - a file name must be specified.";
return;
}
if (null != uplTheFile.PostedFile)
{
try
{
uplTheFile.PostedFile.SaveAs(strBaseLocation+strFi leNameOnServer);
txtOutput.InnerHtml = "File <b>" +
strBaseLocation+strFileNameOnServer+"</b> uploaded successfully";
}
catch (Exception e)
{
txtOutput.InnerHtml = "Error saving <b>" +
strBaseLocation+strFileNameOnServer+"</b><br>"+ e.ToString();
}
}
}
</script>
<form enctype="multipart/form-data" runat="server">
<table>
<tr>
<td>Upload Excel file:</td>
<td><input id="uplTheFile" type=file runat="server"></td>
</tr>
<tr>
<td>Name on server:</td>
<td><input id="txtServername" type="text" runat="server"></td>
</tr>
<tr>
<td colspan="2">
<input type=button id="btnUploadTheFile" value="Upload"
OnServerClick="btnUploadTheFile_Click"
runat="server">
</td>
</tr>
</table>
</form>
<span id=txtOutput style="font: 8pt verdana;" runat="server" />
</body>
</html>
Hi
This is my first asp.net web application. Not sure what is going on.
Here is what I found. When I use <asp:.....> tag its NOTworking. First
listing works but the second doesnt!!!! must be some basic
mistake....pl help me out.
working source.....no <asp:....> tags. when i click on Upload button I
see the text box getting filled with "asdfasdfa"
======================
<% @Page Language="C#" %>
<html>
<head>
<title>File upload in ASP.NET</title>
</head>
<body bgcolor="#ffffff" style="font:8pt verdana;">
<script language="C#" runat="server">
void uploadButton_Click(object sender, System.EventArgs e)
{
txtbox.Value = "asdfasdfa";
}
</script>
<form action="apacx.aspx" method="post" enctype="multipart/form-data"
runat="server">
<input type="text" runat="server" id="txtbox"><p>
<INPUT id="File1" type="file" name="uploadControl"
runat="server">
<INPUT id="uploadButton" type="button"
OnServerClick="uploadButton_Click" runat="server" Value="Upload">
</form>
<span id=txtOutput style="font: 8pt verdana;" runat="server" />
</body>
</html>
this doesn't work....page just returns.
==================
<% @Page Language="C#" %>
<html>
<head>
<title>File upload in ASP.NET</title>
</head>
<body bgcolor="#ffffff" style="font:8pt verdana;">
<script language="C#" runat="server">
void uploadButton_Click(object sender, System.EventArgs e)
{
txtbox.Value = "asdfasdfa";
}
</script>
<form action="apacx.aspx" method="post" enctype="multipart/form-data"
runat="server">
<input type="text" runat="server" id="txtbox"><p>
<INPUT id="File1" type="file" name="uploadControl"
runat="server">
<asp:button id="uploadButton" type="button"
OnServerClick="uploadButton_Click" runat="server"
Text="Upload"></asp:button>
</form>
<span id=txtOutput style="font: 8pt verdana;" runat="server" />
</body>
</html> This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Bill Long |
last post by:
I have a .NET 1.1 application (C#) that I converted to .NET 2.0... Conversion
was pretty painless, code runs from the development environment no problem...
but when I try and publish... It says...
|
by: WT |
last post by:
Hello,
I have been publishing my web site many times to the remote where resides my
final web site.
Everything was ok, but to-day, without any configuration change, vs doesn't
copy final files...
|
by: Tom |
last post by:
I did a Build --Publish web site last night on my web app, It publish
correctly but it created 12 DLL's for it. Is there a way to only get 1 dll
for the entire web project like in 03 or a is there...
|
by: mrajanikrishna |
last post by:
Hi friends,
I've designed an application in my local system using VS.NET 2003.
(VB.NET and ASP.NET)
Its working fine. Now, I want to publish to my ISPs server. I've FTP
account.
How can I...
|
by: Mulm3h |
last post by:
Hi when I publish my application using the publish wizard in VB 2k5
Everything works fine, but after i run through the installation of the application setup.exe. There's a folder missing which...
|
by: Frank Rizzo |
last post by:
I get a ton of warning that are similar to "Unable to apply publish
properties for item "microsoft.visualstudio.shell.interop". The warning
appears for pretty much every reference. The...
|
by: Aussie Rules |
last post by:
Hi,
I use the publish feature within Vs.net 2008, and have it set to increment
on each build/publish
I want to be able to display this as my application version number, but can
not see how to...
|
by: parez |
last post by:
Hi,
I am developing a .net 3.0 win forms(C#) application using vs2008. I
am also using 3rd party controls which are installed in the the GAC.
After i publish the application on the different...
|
by: Anil Gupte/iCinema.com |
last post by:
I seem to have read somewhere that one can do this by copying the
code-behind page into the .aspx file. Is there an easier way?
I tried to create a simple web page (I just need a quick...
|
by: =?Utf-8?B?QWxoYW1icmEgRWlkb3MgRGVzYXJyb2xsbw==?= |
last post by:
Hi misters
USING VS 2005 in XP, VB.NET, CLICK ONCE
I have a Publish of my application, AdministradorWin.exe, in a folder
D:\ClickOnce\instalacionExpedienteElectronico (of a server in my...
|
by: MeoLessi9 |
last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
|
by: Aftab Ahmad |
last post by:
Hello Experts!
I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
|
by: Aftab Ahmad |
last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below.
Dim IE As Object
Set IE =...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
| |