Showing posts with label following. Show all posts
Showing posts with label following. Show all posts

Thursday, March 29, 2012

Office Web Components COM error (Charting)

Hi all,
I am using the Office Web Components (Interop.OWC10.dll) to generate agrapth on my ASP.NET application and am getting the following messagefor some reason...
System.Runtime.InteropServices.COMException (0x80040154) Office Web Components
I have also referenced the following .dll's...
Interop.ADODB.dll
Interop.MSComctlLib.dll
This error occurs in a method I have called GenerateGraph(). The code contained in this method is as follows...
private void GenerateGraph()
{
try
{
//First create a ChartSpace object to hold the chart
OWC10.ChartSpaceClass objCSpace = newOWC10.ChartSpaceClass();

//Add a chart in the ChartSpace. The Add methodreturns a chart object.
OWC10.ChChart objChart = objCSpace.Charts.Add(0);
//Specify the type of the graph to be displayed. Thetype of the graph is specified by the enumerated values inOWC.ChartChartTypeEnum
objChart.Type =OWC10.ChartChartTypeEnum.chChartTypeLine;
//Give title to graph.
objChart.HasTitle = true;
objChart.Title.Caption = "Discontinuity Report";
objChart.Title.Font.Bold = true;
//Give the caption for the X axis and Y axis of thegraph
objChart.Axes[0].HasTitle = true;
objChart.Axes[0].Title.Caption = "Response Time";
objChart.Axes[0].HasTickLabels = true;
objChart.Axes[0].TickLabelSpacing = 5;
//Give the caption for the X axis and Y axis of thegraph
objChart.Axes[1].HasTitle = true;
objChart.Axes[1].Title.Caption = "Calls";
//Populate the Literal Strings For the data
//The categories and values can be given as literalstring with values separated by tabs. With these three values we candraw a single line.*/
//Dim strSeriesName As String = "Responses"
string strCategory = "";
string strValue = "";
//Add a series to the chart's series collection
objChart.SeriesCollection.Add(0);
FillDataStrings(ref strCategory, ref strValue);
//Give the name of the series
objChart.SeriesCollection[0].SetData(OWC10.ChartDimensionsEnum.chDimSeriesNames,System.Convert.ToInt32(OWC10.ChartSpecialDataSourcesEnum.chDataLiteral),""); //strSeriesName)
//Give the Categories
objChart.SeriesCollection[0].SetData(OWC10.ChartDimensionsEnum.chDimCategories,System.Convert.ToInt32(OWC10.ChartSpecialDataSourcesEnum.chDataLiteral),strCategory);
//Give The values
objChart.SeriesCollection[0].SetData(OWC10.ChartDimensionsEnum.chDimValues,System.Convert.ToInt32(OWC10.ChartSpecialDataSourcesEnum.chDataLiteral),strValue);
//Now a chart is ready to export to a GIF.
string strFilename = "PerformanceGraph" +DateTime.Now.ToString("ddMMyyyyhhmmss") + 1000 * 1000 + ".gif";
string strAbsolutePath = (Server.MapPath(".")) +"\\TempFiles\\" + strFilename;
//string strAbsolutePath = (
objCSpace.ExportPicture(strAbsolutePath, "GIF", 800,480);
//Create a relative path to the GIF file.
//If an absolute path is used instead of a relativepath, the file will not be displayed in the client machines as the fileis created in the server, not in the client. */
//string AppName =
//string strAppPath =Rainbow.Settings.Path.ApplicationPhysicalPath + "TempFiles\\" +strFilename;
string strAppPath =Rainbow.Settings.Path.ApplicationRoot + "/TempFiles/" + strFilename;
//Add the image into the placeholder.
string strImageTag = "<IMG SRC=\"" + strAppPath +"\" />";
phChart.Controls.Add(newLiteralControl(strImageTag));
Log.ApplicationLog.Write("Graph paths: \n\rApp Path:" + strAppPath + "\n\rImage Tag Path: " + strImageTag);
}
catch (Exception E)
{
Log.ApplicationLog.Write("Error: " + E);
}
}
For the life of me I can't seem to find out where exactly theproblem lies (though I have found some sources online that state thatthe the COM object may not be registered - I doubt it is this though asit would have been stated in the error message).
Hope someone can help me here.
Tryst
Which line of code is producing that error?
Did you try registering it?

regsvr32 xyz.dll
It doesn't exactly state which line it is one. It just references the method in which the error is called.
The Office Web Components were already installed as we had previous reports using the Office Web Components.
I'm not really sure what the problem can be? Are there any other possible external factors that may be causing this?
Thanks
Tryst

Try the link below for PInvoke(platform invoke). Hope this helps.
http://www.pinvoke.net
I use OWC all over the place, seems to me I get a line number. How about trying this, walk through each line of code and let us know which it dies on?
Or...
I have a little OWC Chart Helper class that I just posted at my blog. Its not very well documented, but perhaps it'll help you out? I write classes like this to help me use complicated stuff like OWC a bit more easily. I also have an Excel helper that is an interface implementing both OWC and Excel models, I'll post it soon. I need to clean these things up.
http://spaces.msn.com/members/mutethis/Blog/cns!1pqaRX9UNoMK6pqNr__0Gnqw!167.entry
HTH

Monday, March 26, 2012

OGC's Web Map Service in .NET Application

I am trying to use OGC Web Map Service (WMS) and Web Feature Service (WFS)
from the following lists:

http://www.geoconnections.org/CGDI...es.type/gcs.cfm
When I try to Add a Web Referrence in an ASP.NET application using Visual
Web Developer Express, it is not recognising the serive URL. For example,
the following as Web Reference:

http://www.bsc-eoc.org/cgi-bin/bsc_...GetCapabilities
Perhaps this is because this Web Service is not a WSDL interface.

What can I do? Is there any example of consuming OGC WMS/WFS in a .NET
application?

Thanks,
......You are correct, WDSL interface is not included in OGC WMS or WFS.
Search for something like [ OGC WMS WFS "WSDL interface" ] and you'll see
some useful information.
Also, many of the standard GIS products have cobbled together code (.NET and
'other') which does what's required, if you want more than a browser view of
Google Earth (etc).
--
IL Thomas

"dotNET learner" <email@.hiddenwrote in message
news:%23XOkYQ2PHHA.780@.TK2MSFTNGP03.phx.gbl...

Quote:

Originally Posted by

>I am trying to use OGC Web Map Service (WMS) and Web Feature Service (WFS)
>from the following lists:
>
http://www.geoconnections.org/CGDI...es.type/gcs.cfm
>
>
When I try to Add a Web Referrence in an ASP.NET application using Visual
Web Developer Express, it is not recognising the serive URL. For example,
the following as Web Reference:
>
http://www.bsc-eoc.org/cgi-bin/bsc_...GetCapabilities
>
Perhaps this is because this Web Service is not a WSDL interface.
>
What can I do? Is there any example of consuming OGC WMS/WFS in a .NET
application?
>
Thanks,
.....
>
>
>
>

OGC's Web Map Service in .NET Application

I am trying to use OGC Web Map Service (WMS) and Web Feature Service (WFS)
from the following lists:
http://www.geoconnections.org/CGDI...es.type/gcs.cfm
When I try to Add a Web Referrence in an ASP.NET application using Visual
Web Developer Express, it is not recognising the serive URL. For example,
the following as Web Reference:
http://www.bsc-eoc.org/cgi-bin/bsc_... />
pabilities
Perhaps this is because this Web Service is not a WSDL interface.
What can I do? Is there any example of consuming OGC WMS/WFS in a .NET
application?
Thanks,
.....You are correct, WDSL interface is not included in OGC WMS or WFS.
Search for something like [ OGC WMS WFS "WSDL interface" ] and you'll see
some useful information.
Also, many of the standard GIS products have cobbled together code (.NET and
'other') which does what's required, if you want more than a browser view of
Google Earth (etc).
--
IL Thomas
"dotNET learner" <email@.hidden> wrote in message
news:%23XOkYQ2PHHA.780@.TK2MSFTNGP03.phx.gbl...
>I am trying to use OGC Web Map Service (WMS) and Web Feature Service (WFS)
>from the following lists:
> http://www.geoconnections.org/CGDI...es.type/gcs.cfm
>
> When I try to Add a Web Referrence in an ASP.NET application using Visual
> Web Developer Express, it is not recognising the serive URL. For example,
> the following as Web Reference:
> http://www.bsc-eoc.org/cgi-bin/bsc_...>
Capabilities
> Perhaps this is because this Web Service is not a WSDL interface.
> What can I do? Is there any example of consuming OGC WMS/WFS in a .NET
> application?
> Thanks,
> .....
>
>

OK , my dumb question for the day

i have a drop down list fill using the following code:
If IsPostBack Then
'Put user code to initialize the page here
' create a sqlconnection
Dim cnn As SqlConnection = New SqlConnection("Data
Source=localhost;Initial catalog=Northwind;" & _
"Integrated Security=SSPI")
'create a sql command
Dim cmd As SqlCommand = cnn.CreateCommand
cmd.CommandType = Data.CommandType.Text
cmd.CommandText = "SELECT * FROM Suppliers"
' Set up the DataAdapter and fill the dataset
Dim da As SqlDataAdapter = New SqlDataAdapter
da.SelectCommand = cmd
Dim ds As Suppliers = New Suppliers
da.Fill(ds, "Suppliers")
Dim suppROW As Suppliers.SuppliersRow
For Each suppROW In ds.Suppliers
Me.ddlData.Items.Add(suppROW.SupplierID & suppROW.CompanyName)
Next
i want to set the text of the drop down to companyname
and the value to the supplierID. What am i missing?
thanks
kesHi Kes,
You need to bind the dataset to the dropdown.
Replace this:

> da.Fill(ds, "Suppliers")
> Dim suppROW As Suppliers.SuppliersRow
> For Each suppROW In ds.Suppliers
> Me.ddlData.Items.Add(suppROW.SupplierID &
suppROW.CompanyName)
> Next
With this:
da.Fill(ds, "Suppliers")
ddlData.DataTextField = "CompanyName"
ddlData.DataValueField = "SupplierID"
ddlData.DataSource = dsSuppliers
ddlData.DataBind()
I'm assuming that your Suppliers object is derived from Dataset in the
example above. Good luck! Ken.
Ken Dopierala Jr.
For great ASP.Net web hosting try:
http://www.webhost4life.com/default.asp?refid=Spinlight
If you sign up under me and need help, email me.
"WebBuilder451" <WebBuilder451@.discussions.microsoft.com> wrote in message
news:AB8DDAD7-DBE8-4093-BD3D-C91677304F3F@.microsoft.com...
> i have a drop down list fill using the following code:
> If IsPostBack Then
> 'Put user code to initialize the page here
> ' create a sqlconnection
> Dim cnn As SqlConnection = New SqlConnection("Data
> Source=localhost;Initial catalog=Northwind;" & _
> "Integrated Security=SSPI")
> 'create a sql command
> Dim cmd As SqlCommand = cnn.CreateCommand
> cmd.CommandType = Data.CommandType.Text
> cmd.CommandText = "SELECT * FROM Suppliers"
> ' Set up the DataAdapter and fill the dataset
> Dim da As SqlDataAdapter = New SqlDataAdapter
> da.SelectCommand = cmd
> Dim ds As Suppliers = New Suppliers
> da.Fill(ds, "Suppliers")
> Dim suppROW As Suppliers.SuppliersRow
> For Each suppROW In ds.Suppliers
> Me.ddlData.Items.Add(suppROW.SupplierID &
suppROW.CompanyName)
> Next
> i want to set the text of the drop down to companyname
> and the value to the supplierID. What am i missing?
> thanks
> kes
and I knew that!!
I'm working through a book and i got brain lock on this
thanks
kes
"Ken Dopierala Jr." wrote:

> Hi Kes,
> You need to bind the dataset to the dropdown.
> Replace this:
>
> suppROW.CompanyName)
> With this:
> da.Fill(ds, "Suppliers")
> ddlData.DataTextField = "CompanyName"
> ddlData.DataValueField = "SupplierID"
> ddlData.DataSource = dsSuppliers
> ddlData.DataBind()
> I'm assuming that your Suppliers object is derived from Dataset in the
> example above. Good luck! Ken.
> --
> Ken Dopierala Jr.
> For great ASP.Net web hosting try:
> http://www.webhost4life.com/default.asp?refid=Spinlight
> If you sign up under me and need help, email me.
> "WebBuilder451" <WebBuilder451@.discussions.microsoft.com> wrote in message
> news:AB8DDAD7-DBE8-4093-BD3D-C91677304F3F@.microsoft.com...
> suppROW.CompanyName)
>
>

OK , my dumb question for the day

i have a drop down list fill using the following code:
If IsPostBack Then
'Put user code to initialize the page here
' create a sqlconnection
Dim cnn As SqlConnection = New SqlConnection("Data
Source=localhost;Initial catalog=Northwind;" & _
"Integrated Security=SSPI")
'create a sql command
Dim cmd As SqlCommand = cnn.CreateCommand
cmd.CommandType = Data.CommandType.Text
cmd.CommandText = "SELECT * FROM Suppliers"
' Set up the DataAdapter and fill the dataset
Dim da As SqlDataAdapter = New SqlDataAdapter
da.SelectCommand = cmd
Dim ds As Suppliers = New Suppliers
da.Fill(ds, "Suppliers")
Dim suppROW As Suppliers.SuppliersRow
For Each suppROW In ds.Suppliers
Me.ddlData.Items.Add(suppROW.SupplierID & suppROW.CompanyName)
Next

i want to set the text of the drop down to companyname
and the value to the supplierID. What am i missing?
thanks
kesHi Kes,

You need to bind the dataset to the dropdown.

Replace this:

> da.Fill(ds, "Suppliers")
> Dim suppROW As Suppliers.SuppliersRow
> For Each suppROW In ds.Suppliers
> Me.ddlData.Items.Add(suppROW.SupplierID &
suppROW.CompanyName)
> Next

With this:

da.Fill(ds, "Suppliers")
ddlData.DataTextField = "CompanyName"
ddlData.DataValueField = "SupplierID"
ddlData.DataSource = dsSuppliers
ddlData.DataBind()

I'm assuming that your Suppliers object is derived from Dataset in the
example above. Good luck! Ken.

--
Ken Dopierala Jr.
For great ASP.Net web hosting try:
http://www.webhost4life.com/default.asp?refid=Spinlight
If you sign up under me and need help, email me.

"WebBuilder451" <WebBuilder451@.discussions.microsoft.com> wrote in message
news:AB8DDAD7-DBE8-4093-BD3D-C91677304F3F@.microsoft.com...
> i have a drop down list fill using the following code:
> If IsPostBack Then
> 'Put user code to initialize the page here
> ' create a sqlconnection
> Dim cnn As SqlConnection = New SqlConnection("Data
> Source=localhost;Initial catalog=Northwind;" & _
> "Integrated Security=SSPI")
> 'create a sql command
> Dim cmd As SqlCommand = cnn.CreateCommand
> cmd.CommandType = Data.CommandType.Text
> cmd.CommandText = "SELECT * FROM Suppliers"
> ' Set up the DataAdapter and fill the dataset
> Dim da As SqlDataAdapter = New SqlDataAdapter
> da.SelectCommand = cmd
> Dim ds As Suppliers = New Suppliers
> da.Fill(ds, "Suppliers")
> Dim suppROW As Suppliers.SuppliersRow
> For Each suppROW In ds.Suppliers
> Me.ddlData.Items.Add(suppROW.SupplierID &
suppROW.CompanyName)
> Next
> i want to set the text of the drop down to companyname
> and the value to the supplierID. What am i missing?
> thanks
> kes
and I knew that!!
I'm working through a book and i got brain lock on this
thanks
kes
"Ken Dopierala Jr." wrote:

> Hi Kes,
> You need to bind the dataset to the dropdown.
> Replace this:
> > da.Fill(ds, "Suppliers")
> > Dim suppROW As Suppliers.SuppliersRow
> > For Each suppROW In ds.Suppliers
> > Me.ddlData.Items.Add(suppROW.SupplierID &
> suppROW.CompanyName)
> > Next
> With this:
> da.Fill(ds, "Suppliers")
> ddlData.DataTextField = "CompanyName"
> ddlData.DataValueField = "SupplierID"
> ddlData.DataSource = dsSuppliers
> ddlData.DataBind()
> I'm assuming that your Suppliers object is derived from Dataset in the
> example above. Good luck! Ken.
> --
> Ken Dopierala Jr.
> For great ASP.Net web hosting try:
> http://www.webhost4life.com/default.asp?refid=Spinlight
> If you sign up under me and need help, email me.
> "WebBuilder451" <WebBuilder451@.discussions.microsoft.com> wrote in message
> news:AB8DDAD7-DBE8-4093-BD3D-C91677304F3F@.microsoft.com...
> > i have a drop down list fill using the following code:
> > If IsPostBack Then
> > 'Put user code to initialize the page here
> > ' create a sqlconnection
> > Dim cnn As SqlConnection = New SqlConnection("Data
> > Source=localhost;Initial catalog=Northwind;" & _
> > "Integrated Security=SSPI")
> > 'create a sql command
> > Dim cmd As SqlCommand = cnn.CreateCommand
> > cmd.CommandType = Data.CommandType.Text
> > cmd.CommandText = "SELECT * FROM Suppliers"
> > ' Set up the DataAdapter and fill the dataset
> > Dim da As SqlDataAdapter = New SqlDataAdapter
> > da.SelectCommand = cmd
> > Dim ds As Suppliers = New Suppliers
> > da.Fill(ds, "Suppliers")
> > Dim suppROW As Suppliers.SuppliersRow
> > For Each suppROW In ds.Suppliers
> > Me.ddlData.Items.Add(suppROW.SupplierID &
> suppROW.CompanyName)
> > Next
> > i want to set the text of the drop down to companyname
> > and the value to the supplierID. What am i missing?
> > thanks
> > kes
>

ok, now it's working. the question is if what i did is correct

I added to the ascx file the following line:
Protected WithEvents cls1 As cls1
where cls1 is the class name of the aspx page and in the
ascx Page_Init i wrote:
cls1 = MyBase.Page
It works fine but - is it the correct way?
Thanks

>--Original Message--
>I have a user control inside an aspx page. I was able to
>create a Public property inside the ascx file and call it
>from the aspx but whatever I do, I can't find the way to
>cause an event from inside the ascx file to call any
>function/sub/property etc. The error I'm getting
>is "Reference to a non-shared member required an object
>reference".
>
>.
>Check out: http://www.openmymind.net/communication/index.html
it takes about communication between a page and a user control including how
to do it via events.
Karl
MY ASP.Net tutorials
http://www.openmymind.net/
"comp" <nice_guy@.inter.net.il> wrote in message
news:95ee01c4d348$81edfc20$a601280a@.phx.gbl...
> I added to the ascx file the following line:
> Protected WithEvents cls1 As cls1
> where cls1 is the class name of the aspx page and in the
> ascx Page_Init i wrote:
> cls1 = MyBase.Page
> It works fine but - is it the correct way?
> Thanks
>

Ok. I give up! Help please

Hi,
I was following the article
http://msdn.microsoft.com/msdnmag/i...ns/default.aspx I
got everything working until I go the the Progress bar section. Here is wher
e
I am stuck.
This is the vb.net code for the wait.aspx page
Public redirectPage As String = ""
Public secondsToWait As String = "0"
Public minutesToWait As String = "0"
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
'If Request.QueryString("redirectPage") <> "" Then
' redirectPage = Request.QueryString("redirectPage")
'End If
Dim secondsToWait As String = Request.QueryString("secondsToWait")
Dim minutesToWait As String = Request.QueryString("minutesToWait")
If (minutesToWait <> String.Empty) Then
secondsToWait = "0"
Else
Dim seconds As Integer = Int32.Parse(secondsToWait)
Dim minutes As Integer = seconds / 60
If (seconds Mod 60 = 0) And (minutes > 1) Then
minutesToWait = minutes.ToString()
secondsToWait = "0"
End If
End If
End Sub
This is the html
<%@dotnet.itags.org. Page Language="vb" AutoEventWireup="false" Codebehind="wait.aspx.vb"
Inherits="Webtest.wait"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>wait</title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5">
<SCRIPT language="javascript">
var i = 0;
function redirectTo(targetPage, querystring, secondsForWaiting,
minutesForWaiting)
{
if (0 < targetPage.length)
{
b1.style.cursor="wait";
location.replace(targetPage + querystring);
if (secondsForWaiting.valueOf() > 0)
{
ProcessingLabel.innerText =
"This process can take up to "
+ secondsForWaiting + " seconds...";
timedIterations(secondsForWaiting);
}
else
{
if (minutesForWaiting.valueOf() > 0)
{
ProcessingLabel.innerText =
"This process can take up to "
+ minutesForWaiting + " minutes...";
timedIterations(minutesForWaiting * 60);
}
}
}
else
{
ProcessingLabel.innerText = "Page not found."
}
}
function timedIterations(secondsForIterating)
{
incrementalWidth = 800 / secondsForIterating;
if (i <= secondsForIterating + 10)
{
d1.innerText="Elapsed time: " + i + " seconds.";
d2.style.width=i*incrementalWidth;
setTimeout(
"timedIterations(" + secondsForIterating + ");",
1000);
i++;
}
else
{
b1.style.cursor="";
d1.style.visibility = "hidden";
d2.style.visibility = "hidden";
ProcessingLabel.innerText =
"The server is taking longer than "
+ "anticipated to process your request. "
+ "Thank you for your patience. "
+ "You can wait a few minutes longer for "
+ "the process to complete, or you can press "
+ "the back button and try again later...";
}
}
</SCRIPT>
</HEAD>
<body id=b1
onload="redirectTo('<%Response.Write(redirectPage)%>','<%Response.Write(Requ
est.Url.Query)%>','<%Response.Write(secondsToWait)%>','<%Response.Write(minu
tesToWait)%>')">
<form id="Form1" method="post" runat="server">
<asp:Label id="ProcessingLabel" runat="server"
CssClass="DarkMediumSizeText">Processing...</asp:Label>
<p></p>
<DIV id="d1" class="DarkSmallSizeText"></DIV>
<DIV id="d2" style="BACKGROUND-COLOR:red"></DIV>
</form>
</body>
</HTML>
When I call the wait page from my "starttheprocess.aspx" page with this
Response.Redirect("Wait.aspx?redirectPage=" + "ProcessTheData.aspx&Data=" +
TextBox1.Text + "&secondsToWait=30")
I get
Page not found.
Thats from the javascript.
Any ideas? Please.
ThanksAre just pasting the Jscript before the HEAD element in ASP.NET(HTML)?
Or you are registering it?
"Chris" wrote:

> Hi,
> I was following the article
> http://msdn.microsoft.com/msdnmag/i...ns/default.aspx
I
> got everything working until I go the the Progress bar section. Here is wh
ere
> I am stuck.
> This is the vb.net code for the wait.aspx page
> Public redirectPage As String = ""
> Public secondsToWait As String = "0"
> Public minutesToWait As String = "0"
>
> Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles MyBase.Load
> 'Put user code to initialize the page here
> 'If Request.QueryString("redirectPage") <> "" Then
> ' redirectPage = Request.QueryString("redirectPage")
> 'End If
> Dim secondsToWait As String = Request.QueryString("secondsToWait")
> Dim minutesToWait As String = Request.QueryString("minutesToWait")
> If (minutesToWait <> String.Empty) Then
> secondsToWait = "0"
> Else
> Dim seconds As Integer = Int32.Parse(secondsToWait)
> Dim minutes As Integer = seconds / 60
> If (seconds Mod 60 = 0) And (minutes > 1) Then
> minutesToWait = minutes.ToString()
> secondsToWait = "0"
> End If
> End If
>
> End Sub
>
> This is the html
>
> <%@. Page Language="vb" AutoEventWireup="false" Codebehind="wait.aspx.vb"
> Inherits="Webtest.wait"%>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> <HTML>
> <HEAD>
> <title>wait</title>
> <meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
> <meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
> <meta name="vs_defaultClientScript" content="JavaScript">
> <meta name="vs_targetSchema"
> content="http://schemas.microsoft.com/intellisense/ie5">
> <SCRIPT language="javascript">
> var i = 0;
> function redirectTo(targetPage, querystring, secondsForWaiting,
> minutesForWaiting)
> {
> if (0 < targetPage.length)
> {
> b1.style.cursor="wait";
> location.replace(targetPage + querystring);
> if (secondsForWaiting.valueOf() > 0)
> {
> ProcessingLabel.innerText =
> "This process can take up to "
> + secondsForWaiting + " seconds...";
> timedIterations(secondsForWaiting);
> }
> else
> {
> if (minutesForWaiting.valueOf() > 0)
> {
> ProcessingLabel.innerText =
> "This process can take up to "
> + minutesForWaiting + " minutes...";
> timedIterations(minutesForWaiting * 60);
> }
> }
> }
> else
> {
> ProcessingLabel.innerText = "Page not found."
> }
> }
> function timedIterations(secondsForIterating)
> {
> incrementalWidth = 800 / secondsForIterating;
> if (i <= secondsForIterating + 10)
> {
> d1.innerText="Elapsed time: " + i + " seconds.";
> d2.style.width=i*incrementalWidth;
> setTimeout(
> "timedIterations(" + secondsForIterating + ");",
> 1000);
> i++;
> }
> else
> {
> b1.style.cursor="";
> d1.style.visibility = "hidden";
> d2.style.visibility = "hidden";
> ProcessingLabel.innerText =
> "The server is taking longer than "
> + "anticipated to process your request. "
> + "Thank you for your patience. "
> + "You can wait a few minutes longer for "
> + "the process to complete, or you can press "
> + "the back button and try again later...";
> }
> }
> </SCRIPT>
>
>
>
> </HEAD>
> <body id=b1
> onload="redirectTo('<%Response.Write(redirectPage)%>','<%Response.Write(Re
quest.Url.Query)%>','<%Response.Write(secondsToWait)%>','<%Response.Write(mi
nutesToWait)%>')">
> <form id="Form1" method="post" runat="server">
> <asp:Label id="ProcessingLabel" runat="server"
> CssClass="DarkMediumSizeText">Processing...</asp:Label>
> <p></p>
> <DIV id="d1" class="DarkSmallSizeText"></DIV>
> <DIV id="d2" style="BACKGROUND-COLOR:red"></DIV>
> </form>
> </body>
> </HTML>
>
> When I call the wait page from my "starttheprocess.aspx" page with this
> Response.Redirect("Wait.aspx?redirectPage=" + "ProcessTheData.aspx&Data="
+
> TextBox1.Text + "&secondsToWait=30")
> I get
> Page not found.
> Thats from the javascript.
> Any ideas? Please.
> Thanks
>
>
What is the address of the "page not found". What appears in the address
bar?
Seems like you could reproduce the problem in 2-3 lines of code around the
Response.Redirect, by hard-coding values, to start.
Jeff
"Chris" <Chris@.discussions.microsoft.com> wrote in message
news:F00528E5-31CA-4D36-9423-11DAC6A7C1CC@.microsoft.com...
> Hi,
> I was following the article
> http://msdn.microsoft.com/msdnmag/i...ns/default.aspx
I
> got everything working until I go the the Progress bar section. Here is
where
> I am stuck.
> This is the vb.net code for the wait.aspx page
> Public redirectPage As String = ""
> Public secondsToWait As String = "0"
> Public minutesToWait As String = "0"
>
> Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles MyBase.Load
> 'Put user code to initialize the page here
> 'If Request.QueryString("redirectPage") <> "" Then
> ' redirectPage = Request.QueryString("redirectPage")
> 'End If
> Dim secondsToWait As String = Request.QueryString("secondsToWait")
> Dim minutesToWait As String = Request.QueryString("minutesToWait")
> If (minutesToWait <> String.Empty) Then
> secondsToWait = "0"
> Else
> Dim seconds As Integer = Int32.Parse(secondsToWait)
> Dim minutes As Integer = seconds / 60
> If (seconds Mod 60 = 0) And (minutes > 1) Then
> minutesToWait = minutes.ToString()
> secondsToWait = "0"
> End If
> End If
>
> End Sub
>
> This is the html
>
> <%@. Page Language="vb" AutoEventWireup="false" Codebehind="wait.aspx.vb"
> Inherits="Webtest.wait"%>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> <HTML>
> <HEAD>
> <title>wait</title>
> <meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
> <meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
> <meta name="vs_defaultClientScript" content="JavaScript">
> <meta name="vs_targetSchema"
> content="http://schemas.microsoft.com/intellisense/ie5">
> <SCRIPT language="javascript">
> var i = 0;
> function redirectTo(targetPage, querystring, secondsForWaiting,
> minutesForWaiting)
> {
> if (0 < targetPage.length)
> {
> b1.style.cursor="wait";
> location.replace(targetPage + querystring);
> if (secondsForWaiting.valueOf() > 0)
> {
> ProcessingLabel.innerText =
> "This process can take up to "
> + secondsForWaiting + " seconds...";
> timedIterations(secondsForWaiting);
> }
> else
> {
> if (minutesForWaiting.valueOf() > 0)
> {
> ProcessingLabel.innerText =
> "This process can take up to "
> + minutesForWaiting + " minutes...";
> timedIterations(minutesForWaiting * 60);
> }
> }
> }
> else
> {
> ProcessingLabel.innerText = "Page not found."
> }
> }
> function timedIterations(secondsForIterating)
> {
> incrementalWidth = 800 / secondsForIterating;
> if (i <= secondsForIterating + 10)
> {
> d1.innerText="Elapsed time: " + i + " seconds.";
> d2.style.width=i*incrementalWidth;
> setTimeout(
> "timedIterations(" + secondsForIterating + ");",
> 1000);
> i++;
> }
> else
> {
> b1.style.cursor="";
> d1.style.visibility = "hidden";
> d2.style.visibility = "hidden";
> ProcessingLabel.innerText =
> "The server is taking longer than "
> + "anticipated to process your request. "
> + "Thank you for your patience. "
> + "You can wait a few minutes longer for "
> + "the process to complete, or you can press "
> + "the back button and try again later...";
> }
> }
> </SCRIPT>
>
>
>
> </HEAD>
> <body id=b1
>
onload="redirectTo('<%Response.Write(redirectPage)%>','<%Response.Write(Requ
est.Url.Query)%>','<%Response.Write(secondsToWait)%>','<%Response.Write(minu
tesToWait)%>')">
> <form id="Form1" method="post" runat="server">
> <asp:Label id="ProcessingLabel" runat="server"
> CssClass="DarkMediumSizeText">Processing...</asp:Label>
> <p></p>
> <DIV id="d1" class="DarkSmallSizeText"></DIV>
> <DIV id="d2" style="BACKGROUND-COLOR:red"></DIV>
> </form>
> </body>
> </HTML>
>
> When I call the wait page from my "starttheprocess.aspx" page with this
> Response.Redirect("Wait.aspx?redirectPage=" + "ProcessTheData.aspx&Data="
+
> TextBox1.Text + "&secondsToWait=30")
> I get
> Page not found.
> Thats from the javascript.
> Any ideas? Please.
> Thanks
>
>
Hi,
Yes I am just pasting the JScript within the HEAD TAG
"Patrick.O.Ige" wrote:
> Are just pasting the Jscript before the HEAD element in ASP.NET(HTML)?
> Or you are registering it?
>
> "Chris" wrote:
>
Hi,
This is the address for the page not found
http://localhost/webtest/Wait.aspx?... />
sToWait=30
"Jeff Dillon" wrote:

> What is the address of the "page not found". What appears in the address
> bar?
> Seems like you could reproduce the problem in 2-3 lines of code around the
> Response.Redirect, by hard-coding values, to start.
> Jeff
> "Chris" <Chris@.discussions.microsoft.com> wrote in message
> news:F00528E5-31CA-4D36-9423-11DAC6A7C1CC@.microsoft.com...
> I
> where
> onload="redirectTo('<%Response.Write(redirectPage)%>','<%Response.Write(Re
qu
> est.Url.Query)%>','<%Response.Write(secondsToWait)%>','<%Response.Write(mi
nu
> tesToWait)%>')">
> +
>
>
So what happens when you manually browse to this page? Does it exist'
And what exactly are you trying to accomplish?
Jeff
"Chris" <Chris@.discussions.microsoft.com> wrote in message
news:382AAAC3-CFD0-4F5D-AA98-30C6303D080C@.microsoft.com...
> Hi,
> This is the address for the page not found
>
[url]http://localhost/webtest/Wait.aspx?redirectPage=ProcessTheData.aspx&Data=th&secondsToWait=30[/url
]
> "Jeff Dillon" wrote:
>
the
http://msdn.microsoft.com/msdnmag/i...ns/default.aspx
is
Request.QueryString("secondsToWait")
Request.QueryString("minutesToWait")
Codebehind="wait.aspx.vb"
onload="redirectTo('<%Response.Write(redirectPage)%>','<%Response.Write(Requ
est.Url.Query)%>','<%Response.Write(secondsToWait)%>','<%Response.Write(minu
this
"ProcessTheData.aspx&Data="

Ok. I give up! Help please

Hi,
I was following the article
http://msdn.microsoft.com/msdnmag/i...ns/default.aspx I
got everything working until I go the the Progress bar section. Here is where
I am stuck.

This is the vb.net code for the wait.aspx page

Public redirectPage As String = ""
Public secondsToWait As String = "0"
Public minutesToWait As String = "0"

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

'Put user code to initialize the page here

'If Request.QueryString("redirectPage") <> "" Then
' redirectPage = Request.QueryString("redirectPage")
'End If

Dim secondsToWait As String = Request.QueryString("secondsToWait")
Dim minutesToWait As String = Request.QueryString("minutesToWait")

If (minutesToWait <> String.Empty) Then
secondsToWait = "0"
Else
Dim seconds As Integer = Int32.Parse(secondsToWait)
Dim minutes As Integer = seconds / 60

If (seconds Mod 60 = 0) And (minutes > 1) Then
minutesToWait = minutes.ToString()
secondsToWait = "0"
End If

End If

End Sub

This is the html

<%@dotnet.itags.org. Page Language="vb" AutoEventWireup="false" Codebehind="wait.aspx.vb"
Inherits="Webtest.wait"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>wait</title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5"
<SCRIPT language="javascript">
var i = 0;
function redirectTo(targetPage, querystring, secondsForWaiting,
minutesForWaiting)
{
if (0 < targetPage.length)
{
b1.style.cursor="wait";
location.replace(targetPage + querystring);

if (secondsForWaiting.valueOf() > 0)
{
ProcessingLabel.innerText =
"This process can take up to "
+ secondsForWaiting + " seconds...";
timedIterations(secondsForWaiting);
}
else
{
if (minutesForWaiting.valueOf() > 0)
{
ProcessingLabel.innerText =
"This process can take up to "
+ minutesForWaiting + " minutes...";
timedIterations(minutesForWaiting * 60);
}
}
}
else
{
ProcessingLabel.innerText = "Page not found."
}
}

function timedIterations(secondsForIterating)
{
incrementalWidth = 800 / secondsForIterating;
if (i <= secondsForIterating + 10)
{
d1.innerText="Elapsed time: " + i + " seconds.";
d2.style.width=i*incrementalWidth;
setTimeout(
"timedIterations(" + secondsForIterating + ");",
1000);
i++;
}
else
{
b1.style.cursor="";
d1.style.visibility = "hidden";
d2.style.visibility = "hidden";
ProcessingLabel.innerText =
"The server is taking longer than "
+ "anticipated to process your request. "
+ "Thank you for your patience. "
+ "You can wait a few minutes longer for "
+ "the process to complete, or you can press "
+ "the back button and try again later...";
}
}
</SCRIPT
</HEAD>
<body id=b1
onload="redirectTo('<%Response.Write(redirectPage)%>','<%Response.Write(Request.Url.Query)%>','<%Response.Write(secondsToWait)%>','<%Response.Write(minutesToWait)%>')">
<form id="Form1" method="post" runat="server">
<asp:Label id="ProcessingLabel" runat="server"
CssClass="DarkMediumSizeText">Processing...</asp:Label>
<p></p>
<DIV id="d1" class="DarkSmallSizeText"></DIV>
<DIV id="d2" style="BACKGROUND-COLOR:red"></DIV>
</form>
</body>
</HTML
When I call the wait page from my "starttheprocess.aspx" page with this

Response.Redirect("Wait.aspx?redirectPage=" + "ProcessTheData.aspx&Data=" +
TextBox1.Text + "&secondsToWait=30")

I get

Page not found.

Thats from the javascript.

Any ideas? Please.

ThanksAre just pasting the Jscript before the HEAD element in ASP.NET(HTML)?
Or you are registering it?

"Chris" wrote:

> Hi,
> I was following the article
> http://msdn.microsoft.com/msdnmag/i...ns/default.aspx I
> got everything working until I go the the Progress bar section. Here is where
> I am stuck.
> This is the vb.net code for the wait.aspx page
> Public redirectPage As String = ""
> Public secondsToWait As String = "0"
> Public minutesToWait As String = "0"
>
> Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles MyBase.Load
> 'Put user code to initialize the page here
> 'If Request.QueryString("redirectPage") <> "" Then
> ' redirectPage = Request.QueryString("redirectPage")
> 'End If
> Dim secondsToWait As String = Request.QueryString("secondsToWait")
> Dim minutesToWait As String = Request.QueryString("minutesToWait")
> If (minutesToWait <> String.Empty) Then
> secondsToWait = "0"
> Else
> Dim seconds As Integer = Int32.Parse(secondsToWait)
> Dim minutes As Integer = seconds / 60
> If (seconds Mod 60 = 0) And (minutes > 1) Then
> minutesToWait = minutes.ToString()
> secondsToWait = "0"
> End If
> End If
>
> End Sub
>
> This is the html
>
> <%@. Page Language="vb" AutoEventWireup="false" Codebehind="wait.aspx.vb"
> Inherits="Webtest.wait"%>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> <HTML>
> <HEAD>
> <title>wait</title>
> <meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
> <meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
> <meta name="vs_defaultClientScript" content="JavaScript">
> <meta name="vs_targetSchema"
> content="http://schemas.microsoft.com/intellisense/ie5">
> <SCRIPT language="javascript">
> var i = 0;
> function redirectTo(targetPage, querystring, secondsForWaiting,
> minutesForWaiting)
> {
> if (0 < targetPage.length)
> {
> b1.style.cursor="wait";
> location.replace(targetPage + querystring);
> if (secondsForWaiting.valueOf() > 0)
> {
> ProcessingLabel.innerText =
> "This process can take up to "
> + secondsForWaiting + " seconds...";
> timedIterations(secondsForWaiting);
> }
> else
> {
> if (minutesForWaiting.valueOf() > 0)
> {
> ProcessingLabel.innerText =
> "This process can take up to "
> + minutesForWaiting + " minutes...";
> timedIterations(minutesForWaiting * 60);
> }
> }
> }
> else
> {
> ProcessingLabel.innerText = "Page not found."
> }
> }
> function timedIterations(secondsForIterating)
> {
> incrementalWidth = 800 / secondsForIterating;
> if (i <= secondsForIterating + 10)
> {
> d1.innerText="Elapsed time: " + i + " seconds.";
> d2.style.width=i*incrementalWidth;
> setTimeout(
> "timedIterations(" + secondsForIterating + ");",
> 1000);
> i++;
> }
> else
> {
> b1.style.cursor="";
> d1.style.visibility = "hidden";
> d2.style.visibility = "hidden";
> ProcessingLabel.innerText =
> "The server is taking longer than "
> + "anticipated to process your request. "
> + "Thank you for your patience. "
> + "You can wait a few minutes longer for "
> + "the process to complete, or you can press "
> + "the back button and try again later...";
> }
> }
> </SCRIPT>
>
>
>
> </HEAD>
> <body id=b1
> onload="redirectTo('<%Response.Write(redirectPage)%>','<%Response.Write(Request.Url.Query)%>','<%Response.Write(secondsToWait)%>','<%Response.Write(minutesToWait)%>')">
> <form id="Form1" method="post" runat="server">
> <asp:Label id="ProcessingLabel" runat="server"
> CssClass="DarkMediumSizeText">Processing...</asp:Label>
> <p></p>
> <DIV id="d1" class="DarkSmallSizeText"></DIV>
> <DIV id="d2" style="BACKGROUND-COLOR:red"></DIV>
> </form>
> </body>
> </HTML>
>
> When I call the wait page from my "starttheprocess.aspx" page with this
> Response.Redirect("Wait.aspx?redirectPage=" + "ProcessTheData.aspx&Data=" +
> TextBox1.Text + "&secondsToWait=30")
> I get
> Page not found.
> Thats from the javascript.
> Any ideas? Please.
> Thanks
>
>
What is the address of the "page not found". What appears in the address
bar?

Seems like you could reproduce the problem in 2-3 lines of code around the
Response.Redirect, by hard-coding values, to start.

Jeff
"Chris" <Chris@.discussions.microsoft.com> wrote in message
news:F00528E5-31CA-4D36-9423-11DAC6A7C1CC@.microsoft.com...
> Hi,
> I was following the article
> http://msdn.microsoft.com/msdnmag/i...ns/default.aspx
I
> got everything working until I go the the Progress bar section. Here is
where
> I am stuck.
> This is the vb.net code for the wait.aspx page
> Public redirectPage As String = ""
> Public secondsToWait As String = "0"
> Public minutesToWait As String = "0"
>
> Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles MyBase.Load
> 'Put user code to initialize the page here
> 'If Request.QueryString("redirectPage") <> "" Then
> ' redirectPage = Request.QueryString("redirectPage")
> 'End If
> Dim secondsToWait As String = Request.QueryString("secondsToWait")
> Dim minutesToWait As String = Request.QueryString("minutesToWait")
> If (minutesToWait <> String.Empty) Then
> secondsToWait = "0"
> Else
> Dim seconds As Integer = Int32.Parse(secondsToWait)
> Dim minutes As Integer = seconds / 60
> If (seconds Mod 60 = 0) And (minutes > 1) Then
> minutesToWait = minutes.ToString()
> secondsToWait = "0"
> End If
> End If
>
> End Sub
>
> This is the html
>
> <%@. Page Language="vb" AutoEventWireup="false" Codebehind="wait.aspx.vb"
> Inherits="Webtest.wait"%>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> <HTML>
> <HEAD>
> <title>wait</title>
> <meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
> <meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
> <meta name="vs_defaultClientScript" content="JavaScript">
> <meta name="vs_targetSchema"
> content="http://schemas.microsoft.com/intellisense/ie5">
> <SCRIPT language="javascript">
> var i = 0;
> function redirectTo(targetPage, querystring, secondsForWaiting,
> minutesForWaiting)
> {
> if (0 < targetPage.length)
> {
> b1.style.cursor="wait";
> location.replace(targetPage + querystring);
> if (secondsForWaiting.valueOf() > 0)
> {
> ProcessingLabel.innerText =
> "This process can take up to "
> + secondsForWaiting + " seconds...";
> timedIterations(secondsForWaiting);
> }
> else
> {
> if (minutesForWaiting.valueOf() > 0)
> {
> ProcessingLabel.innerText =
> "This process can take up to "
> + minutesForWaiting + " minutes...";
> timedIterations(minutesForWaiting * 60);
> }
> }
> }
> else
> {
> ProcessingLabel.innerText = "Page not found."
> }
> }
> function timedIterations(secondsForIterating)
> {
> incrementalWidth = 800 / secondsForIterating;
> if (i <= secondsForIterating + 10)
> {
> d1.innerText="Elapsed time: " + i + " seconds.";
> d2.style.width=i*incrementalWidth;
> setTimeout(
> "timedIterations(" + secondsForIterating + ");",
> 1000);
> i++;
> }
> else
> {
> b1.style.cursor="";
> d1.style.visibility = "hidden";
> d2.style.visibility = "hidden";
> ProcessingLabel.innerText =
> "The server is taking longer than "
> + "anticipated to process your request. "
> + "Thank you for your patience. "
> + "You can wait a few minutes longer for "
> + "the process to complete, or you can press "
> + "the back button and try again later...";
> }
> }
> </SCRIPT>
>
>
>
> </HEAD>
> <body id=b1
onload="redirectTo('<%Response.Write(redirectPage)%>','<%Response.Write(Requ
est.Url.Query)%>','<%Response.Write(secondsToWait)%>','<%Response.Write(minu
tesToWait)%>')">
> <form id="Form1" method="post" runat="server">
> <asp:Label id="ProcessingLabel" runat="server"
> CssClass="DarkMediumSizeText">Processing...</asp:Label>
> <p></p>
> <DIV id="d1" class="DarkSmallSizeText"></DIV>
> <DIV id="d2" style="BACKGROUND-COLOR:red"></DIV>
> </form>
> </body>
> </HTML>
>
> When I call the wait page from my "starttheprocess.aspx" page with this
> Response.Redirect("Wait.aspx?redirectPage=" + "ProcessTheData.aspx&Data="
+
> TextBox1.Text + "&secondsToWait=30")
> I get
> Page not found.
> Thats from the javascript.
> Any ideas? Please.
> Thanks
>
Hi,
Yes I am just pasting the JScript within the HEAD TAG

"Patrick.O.Ige" wrote:

> Are just pasting the Jscript before the HEAD element in ASP.NET(HTML)?
> Or you are registering it?
>
> "Chris" wrote:
> > Hi,
> > I was following the article
> > http://msdn.microsoft.com/msdnmag/i...ns/default.aspx I
> > got everything working until I go the the Progress bar section. Here is where
> > I am stuck.
> > This is the vb.net code for the wait.aspx page
> > Public redirectPage As String = ""
> > Public secondsToWait As String = "0"
> > Public minutesToWait As String = "0"
> > Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> > System.EventArgs) Handles MyBase.Load
> > 'Put user code to initialize the page here
> > 'If Request.QueryString("redirectPage") <> "" Then
> > ' redirectPage = Request.QueryString("redirectPage")
> > 'End If
> > Dim secondsToWait As String = Request.QueryString("secondsToWait")
> > Dim minutesToWait As String = Request.QueryString("minutesToWait")
> > If (minutesToWait <> String.Empty) Then
> > secondsToWait = "0"
> > Else
> > Dim seconds As Integer = Int32.Parse(secondsToWait)
> > Dim minutes As Integer = seconds / 60
> > If (seconds Mod 60 = 0) And (minutes > 1) Then
> > minutesToWait = minutes.ToString()
> > secondsToWait = "0"
> > End If
> > End If
> > End Sub
> > This is the html
> > <%@. Page Language="vb" AutoEventWireup="false" Codebehind="wait.aspx.vb"
> > Inherits="Webtest.wait"%>
> > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> > <HTML>
> > <HEAD>
> > <title>wait</title>
> > <meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
> > <meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
> > <meta name="vs_defaultClientScript" content="JavaScript">
> > <meta name="vs_targetSchema"
> > content="http://schemas.microsoft.com/intellisense/ie5">
> > <SCRIPT language="javascript">
> > var i = 0;
> > function redirectTo(targetPage, querystring, secondsForWaiting,
> > minutesForWaiting)
> > {
> > if (0 < targetPage.length)
> > {
> > b1.style.cursor="wait";
> > location.replace(targetPage + querystring);
> > if (secondsForWaiting.valueOf() > 0)
> > {
> > ProcessingLabel.innerText =
> > "This process can take up to "
> > + secondsForWaiting + " seconds...";
> > timedIterations(secondsForWaiting);
> > }
> > else
> > {
> > if (minutesForWaiting.valueOf() > 0)
> > {
> > ProcessingLabel.innerText =
> > "This process can take up to "
> > + minutesForWaiting + " minutes...";
> > timedIterations(minutesForWaiting * 60);
> > }
> > }
> > }
> > else
> > {
> > ProcessingLabel.innerText = "Page not found."
> > }
> > }
> > function timedIterations(secondsForIterating)
> > {
> > incrementalWidth = 800 / secondsForIterating;
> > if (i <= secondsForIterating + 10)
> > {
> > d1.innerText="Elapsed time: " + i + " seconds.";
> > d2.style.width=i*incrementalWidth;
> > setTimeout(
> > "timedIterations(" + secondsForIterating + ");",
> > 1000);
> > i++;
> > }
> > else
> > {
> > b1.style.cursor="";
> > d1.style.visibility = "hidden";
> > d2.style.visibility = "hidden";
> > ProcessingLabel.innerText =
> > "The server is taking longer than "
> > + "anticipated to process your request. "
> > + "Thank you for your patience. "
> > + "You can wait a few minutes longer for "
> > + "the process to complete, or you can press "
> > + "the back button and try again later...";
> > }
> > }
> > </SCRIPT>
> > </HEAD>
> > <body id=b1
> > onload="redirectTo('<%Response.Write(redirectPage)%>','<%Response.Write(Request.Url.Query)%>','<%Response.Write(secondsToWait)%>','<%Response.Write(minutesToWait)%>')">
> > <form id="Form1" method="post" runat="server">
> > <asp:Label id="ProcessingLabel" runat="server"
> > CssClass="DarkMediumSizeText">Processing...</asp:Label>
> > <p></p>
> > <DIV id="d1" class="DarkSmallSizeText"></DIV>
> > <DIV id="d2" style="BACKGROUND-COLOR:red"></DIV>
> > </form>
> > </body>
> > </HTML>
> > When I call the wait page from my "starttheprocess.aspx" page with this
> > Response.Redirect("Wait.aspx?redirectPage=" + "ProcessTheData.aspx&Data=" +
> > TextBox1.Text + "&secondsToWait=30")
> > I get
> > Page not found.
> > Thats from the javascript.
> > Any ideas? Please.
> > Thanks
Hi,
This is the address for the page not found

http://localhost/webtest/Wait.aspx?...econdsToWait=30

"Jeff Dillon" wrote:

> What is the address of the "page not found". What appears in the address
> bar?
> Seems like you could reproduce the problem in 2-3 lines of code around the
> Response.Redirect, by hard-coding values, to start.
> Jeff
> "Chris" <Chris@.discussions.microsoft.com> wrote in message
> news:F00528E5-31CA-4D36-9423-11DAC6A7C1CC@.microsoft.com...
> > Hi,
> > I was following the article
> > http://msdn.microsoft.com/msdnmag/i...ns/default.aspx
> I
> > got everything working until I go the the Progress bar section. Here is
> where
> > I am stuck.
> > This is the vb.net code for the wait.aspx page
> > Public redirectPage As String = ""
> > Public secondsToWait As String = "0"
> > Public minutesToWait As String = "0"
> > Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> > System.EventArgs) Handles MyBase.Load
> > 'Put user code to initialize the page here
> > 'If Request.QueryString("redirectPage") <> "" Then
> > ' redirectPage = Request.QueryString("redirectPage")
> > 'End If
> > Dim secondsToWait As String = Request.QueryString("secondsToWait")
> > Dim minutesToWait As String = Request.QueryString("minutesToWait")
> > If (minutesToWait <> String.Empty) Then
> > secondsToWait = "0"
> > Else
> > Dim seconds As Integer = Int32.Parse(secondsToWait)
> > Dim minutes As Integer = seconds / 60
> > If (seconds Mod 60 = 0) And (minutes > 1) Then
> > minutesToWait = minutes.ToString()
> > secondsToWait = "0"
> > End If
> > End If
> > End Sub
> > This is the html
> > <%@. Page Language="vb" AutoEventWireup="false" Codebehind="wait.aspx.vb"
> > Inherits="Webtest.wait"%>
> > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> > <HTML>
> > <HEAD>
> > <title>wait</title>
> > <meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
> > <meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
> > <meta name="vs_defaultClientScript" content="JavaScript">
> > <meta name="vs_targetSchema"
> > content="http://schemas.microsoft.com/intellisense/ie5">
> > <SCRIPT language="javascript">
> > var i = 0;
> > function redirectTo(targetPage, querystring, secondsForWaiting,
> > minutesForWaiting)
> > {
> > if (0 < targetPage.length)
> > {
> > b1.style.cursor="wait";
> > location.replace(targetPage + querystring);
> > if (secondsForWaiting.valueOf() > 0)
> > {
> > ProcessingLabel.innerText =
> > "This process can take up to "
> > + secondsForWaiting + " seconds...";
> > timedIterations(secondsForWaiting);
> > }
> > else
> > {
> > if (minutesForWaiting.valueOf() > 0)
> > {
> > ProcessingLabel.innerText =
> > "This process can take up to "
> > + minutesForWaiting + " minutes...";
> > timedIterations(minutesForWaiting * 60);
> > }
> > }
> > }
> > else
> > {
> > ProcessingLabel.innerText = "Page not found."
> > }
> > }
> > function timedIterations(secondsForIterating)
> > {
> > incrementalWidth = 800 / secondsForIterating;
> > if (i <= secondsForIterating + 10)
> > {
> > d1.innerText="Elapsed time: " + i + " seconds.";
> > d2.style.width=i*incrementalWidth;
> > setTimeout(
> > "timedIterations(" + secondsForIterating + ");",
> > 1000);
> > i++;
> > }
> > else
> > {
> > b1.style.cursor="";
> > d1.style.visibility = "hidden";
> > d2.style.visibility = "hidden";
> > ProcessingLabel.innerText =
> > "The server is taking longer than "
> > + "anticipated to process your request. "
> > + "Thank you for your patience. "
> > + "You can wait a few minutes longer for "
> > + "the process to complete, or you can press "
> > + "the back button and try again later...";
> > }
> > }
> > </SCRIPT>
> > </HEAD>
> > <body id=b1
> onload="redirectTo('<%Response.Write(redirectPage)%>','<%Response.Write(Requ
> est.Url.Query)%>','<%Response.Write(secondsToWait)%>','<%Response.Write(minu
> tesToWait)%>')">
> > <form id="Form1" method="post" runat="server">
> > <asp:Label id="ProcessingLabel" runat="server"
> > CssClass="DarkMediumSizeText">Processing...</asp:Label>
> > <p></p>
> > <DIV id="d1" class="DarkSmallSizeText"></DIV>
> > <DIV id="d2" style="BACKGROUND-COLOR:red"></DIV>
> > </form>
> > </body>
> > </HTML>
> > When I call the wait page from my "starttheprocess.aspx" page with this
> > Response.Redirect("Wait.aspx?redirectPage=" + "ProcessTheData.aspx&Data="
> +
> > TextBox1.Text + "&secondsToWait=30")
> > I get
> > Page not found.
> > Thats from the javascript.
> > Any ideas? Please.
> > Thanks
>
So what happens when you manually browse to this page? Does it exist??

And what exactly are you trying to accomplish?

Jeff
"Chris" <Chris@.discussions.microsoft.com> wrote in message
news:382AAAC3-CFD0-4F5D-AA98-30C6303D080C@.microsoft.com...
> Hi,
> This is the address for the page not found
>
http://localhost/webtest/Wait.aspx?...econdsToWait=30
> "Jeff Dillon" wrote:
> > What is the address of the "page not found". What appears in the address
> > bar?
> > Seems like you could reproduce the problem in 2-3 lines of code around
the
> > Response.Redirect, by hard-coding values, to start.
> > Jeff
> > "Chris" <Chris@.discussions.microsoft.com> wrote in message
> > news:F00528E5-31CA-4D36-9423-11DAC6A7C1CC@.microsoft.com...
> > > Hi,
> > > I was following the article
> http://msdn.microsoft.com/msdnmag/i...ns/default.aspx
> > I
> > > got everything working until I go the the Progress bar section. Here
is
> > where
> > > I am stuck.
> > > > This is the vb.net code for the wait.aspx page
> > > > Public redirectPage As String = ""
> > > Public secondsToWait As String = "0"
> > > Public minutesToWait As String = "0"
> > > > > Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> > > System.EventArgs) Handles MyBase.Load
> > > > 'Put user code to initialize the page here
> > > > 'If Request.QueryString("redirectPage") <> "" Then
> > > ' redirectPage = Request.QueryString("redirectPage")
> > > 'End If
> > > > Dim secondsToWait As String =
Request.QueryString("secondsToWait")
> > > Dim minutesToWait As String =
Request.QueryString("minutesToWait")
> > > > If (minutesToWait <> String.Empty) Then
> > > secondsToWait = "0"
> > > Else
> > > Dim seconds As Integer = Int32.Parse(secondsToWait)
> > > Dim minutes As Integer = seconds / 60
> > > > If (seconds Mod 60 = 0) And (minutes > 1) Then
> > > minutesToWait = minutes.ToString()
> > > secondsToWait = "0"
> > > End If
> > > > End If
> > > > > End Sub
> > > > > > This is the html
> > > > > <%@. Page Language="vb" AutoEventWireup="false"
Codebehind="wait.aspx.vb"
> > > Inherits="Webtest.wait"%>
> > > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> > > <HTML>
> > > <HEAD>
> > > <title>wait</title>
> > > <meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
> > > <meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
> > > <meta name="vs_defaultClientScript" content="JavaScript">
> > > <meta name="vs_targetSchema"
> > > content="http://schemas.microsoft.com/intellisense/ie5">
> > > > <SCRIPT language="javascript">
> > > var i = 0;
> > > function redirectTo(targetPage, querystring, secondsForWaiting,
> > > minutesForWaiting)
> > > {
> > > if (0 < targetPage.length)
> > > {
> > > b1.style.cursor="wait";
> > > location.replace(targetPage + querystring);
> > > > if (secondsForWaiting.valueOf() > 0)
> > > {
> > > ProcessingLabel.innerText =
> > > "This process can take up to "
> > > + secondsForWaiting + " seconds...";
> > > timedIterations(secondsForWaiting);
> > > }
> > > else
> > > {
> > > if (minutesForWaiting.valueOf() > 0)
> > > {
> > > ProcessingLabel.innerText =
> > > "This process can take up to "
> > > + minutesForWaiting + " minutes...";
> > > timedIterations(minutesForWaiting * 60);
> > > }
> > > }
> > > }
> > > else
> > > {
> > > ProcessingLabel.innerText = "Page not found."
> > > }
> > > }
> > > > function timedIterations(secondsForIterating)
> > > {
> > > incrementalWidth = 800 / secondsForIterating;
> > > if (i <= secondsForIterating + 10)
> > > {
> > > d1.innerText="Elapsed time: " + i + " seconds.";
> > > d2.style.width=i*incrementalWidth;
> > > setTimeout(
> > > "timedIterations(" + secondsForIterating + ");",
> > > 1000);
> > > i++;
> > > }
> > > else
> > > {
> > > b1.style.cursor="";
> > > d1.style.visibility = "hidden";
> > > d2.style.visibility = "hidden";
> > > ProcessingLabel.innerText =
> > > "The server is taking longer than "
> > > + "anticipated to process your request. "
> > > + "Thank you for your patience. "
> > > + "You can wait a few minutes longer for "
> > > + "the process to complete, or you can press "
> > > + "the back button and try again later...";
> > > }
> > > }
> > > </SCRIPT>
> > > > > > > > > </HEAD>
> > > <body id=b1
> onload="redirectTo('<%Response.Write(redirectPage)%>','<%Response.Write(Requ
est.Url.Query)%>','<%Response.Write(secondsToWait)%>','<%Response.Write(minu
> > tesToWait)%>')">
> > > <form id="Form1" method="post" runat="server">
> > > <asp:Label id="ProcessingLabel" runat="server"
> > > CssClass="DarkMediumSizeText">Processing...</asp:Label>
> > > <p></p>
> > > <DIV id="d1" class="DarkSmallSizeText"></DIV>
> > > <DIV id="d2" style="BACKGROUND-COLOR:red"></DIV>
> > > </form>
> > > </body>
> > > </HTML>
> > > > > When I call the wait page from my "starttheprocess.aspx" page with
this
> > > > Response.Redirect("Wait.aspx?redirectPage=" +
"ProcessTheData.aspx&Data="
> > +
> > > TextBox1.Text + "&secondsToWait=30")
> > > > I get
> > > > Page not found.
> > > > Thats from the javascript.
> > > > Any ideas? Please.
> > > > Thanks
> > > >

Saturday, March 24, 2012

Okay, how do I get the "name" of the image?...

The following code is supposed to create a rollover image for an ImageButton WebControl that is inside of a Repeater WebControl. The only problem is that it won't work because I don't know how to get the "name" of the image that ASP.NET gives the image at runtime.. Here is the code...


protected void rptrNewReleases_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
ImageButton imgbtnImageButton = (ImageButton)e.Item.FindControl("imgAddToCart");

// (e) needs to be replaced with the "name" this image is given at runtime, but how?
imgbtnImageButton.Attributes.Add("onmouseover", "MM_swapImage('" + (e) + "','','button_addtocart_on.jpg',1)");
imgbtnImageButton.Attributes.Add("onmouseout", "MM_swapImgRestore ()");
}

The name of the image in the first Item is something like name="rptrRepeateRegion:ctl0:imgAddToCartButton"

In the second (Alternating) Item it is name="rptrRepeateRegion:ctl1:imgAddToCartButton"

and so forth...

Is there any function to get this name that ASP.NET creates?

for example: e.Item.ItemName (something like this...)

Thanks (hope this makes sense)Have you tried imgbtnImageButton.ID?

Thursday, March 22, 2012

OLEdb problem

I use the following function to read an Excel worksheet into a dataset:
Public Function GetDataFromExcel(ByVal FileName As String, ByVal ds As
DataSet) As Boolean
Try
Dim strConn As String = "Provider=Microsoft.Jet.OLEDB.4.0; Data
Source=" & FileName & "; Extended Properties=Excel 8.0;"
Dim objConn As New System.Data.OleDb.OleDbConnection(strConn)
objConn.Open()
' Create objects ready to grab data
Dim objCmd As New System.Data.OleDb.OleDbCommand("SELECT * FROM
[sheet1$]", objConn)
Dim objDA As New System.Data.OleDb.OleDbDataAdapter
objDA.SelectCommand = objCmd
' Fill DataSet
objDA.Fill(ds)
' Clean up and return
objConn.Close()
Return True
Catch ex As Exception
lblHeading.Text = ex.ToString
Return False
End Try
End Function
When I run my ASPX on my own PC it runs fine and does what it must do.
When I put the page on the server I get this message:
System.Data.OleDb.OleDbException: Unspecified error at
System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr) at
System.Data.OleDb.OleDbConnection.InitializeProvider() at
System.Data.OleDb.OleDbConnection.Open() at
FSsite.FSsite.WebFormSubmit.GetDataFromExcel(String FileName, DataSet ds)
Now I copied to System.Data.OleDb.dll file to the BIN folder at the IIS
webserver, but is there anything else I should do?
Can anyone explain to me what this means, it's a little vage error message?
thanks,
EricI would guess a security error, or a path error.
What is the FileName, and can ASPNET (or the ASPNET use id on the server)
read it ?
I would highly doubt that you need Oledb.dll in the bin directory.
"EMW" <someone_@._MS.com> wrote in message
news:418f3626$0$44069$5fc3050@.dreader2.news.tiscali.nl...
>I use the following function to read an Excel worksheet into a dataset:
> Public Function GetDataFromExcel(ByVal FileName As String, ByVal ds As
> DataSet) As Boolean
> Try
> Dim strConn As String = "Provider=Microsoft.Jet.OLEDB.4.0; Data
> Source=" & FileName & "; Extended Properties=Excel 8.0;"
> Dim objConn As New System.Data.OleDb.OleDbConnection(strConn)
> objConn.Open()
> ' Create objects ready to grab data
> Dim objCmd As New System.Data.OleDb.OleDbCommand("SELECT * FROM
> [sheet1$]", objConn)
> Dim objDA As New System.Data.OleDb.OleDbDataAdapter
> objDA.SelectCommand = objCmd
> ' Fill DataSet
> objDA.Fill(ds)
> ' Clean up and return
> objConn.Close()
> Return True
> Catch ex As Exception
> lblHeading.Text = ex.ToString
> Return False
> End Try
> End Function
> When I run my ASPX on my own PC it runs fine and does what it must do.
> When I put the page on the server I get this message:
> System.Data.OleDb.OleDbException: Unspecified error at
> System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr) at
> System.Data.OleDb.OleDbConnection.InitializeProvider() at
> System.Data.OleDb.OleDbConnection.Open() at
> FSsite.FSsite.WebFormSubmit.GetDataFromExcel(String FileName, DataSet ds)
> Now I copied to System.Data.OleDb.dll file to the BIN folder at the IIS
> webserver, but is there anything else I should do?
> Can anyone explain to me what this means, it's a little vage error
> message?
> thanks,
> Eric
>

OLEdb problem

I use the following function to read an Excel worksheet into a dataset:

Public Function GetDataFromExcel(ByVal FileName As String, ByVal ds As
DataSet) As Boolean
Try
Dim strConn As String = "Provider=Microsoft.Jet.OLEDB.4.0; Data
Source=" & FileName & "; Extended Properties=Excel 8.0;"
Dim objConn As New System.Data.OleDb.OleDbConnection(strConn)
objConn.Open()
' Create objects ready to grab data
Dim objCmd As New System.Data.OleDb.OleDbCommand("SELECT * FROM
[sheet1$]", objConn)
Dim objDA As New System.Data.OleDb.OleDbDataAdapter
objDA.SelectCommand = objCmd
' Fill DataSet
objDA.Fill(ds)
' Clean up and return
objConn.Close()
Return True
Catch ex As Exception
lblHeading.Text = ex.ToString
Return False
End Try
End Function

When I run my ASPX on my own PC it runs fine and does what it must do.

When I put the page on the server I get this message:

System.Data.OleDb.OleDbException: Unspecified error at
System.Data.OleDb.OleDbConnection.ProcessResults(I nt32 hr) at
System.Data.OleDb.OleDbConnection.InitializeProvid er() at
System.Data.OleDb.OleDbConnection.Open() at
FSsite.FSsite.WebFormSubmit.GetDataFromExcel(Strin g FileName, DataSet ds)

Now I copied to System.Data.OleDb.dll file to the BIN folder at the IIS
webserver, but is there anything else I should do?
Can anyone explain to me what this means, it's a little vage error message?

thanks,
EricI would guess a security error, or a path error.
What is the FileName, and can ASPNET (or the ASPNET use id on the server)
read it ?
I would highly doubt that you need Oledb.dll in the bin directory.

"EMW" <someone_@._MS.com> wrote in message
news:418f3626$0$44069$5fc3050@.dreader2.news.tiscal i.nl...
>I use the following function to read an Excel worksheet into a dataset:
> Public Function GetDataFromExcel(ByVal FileName As String, ByVal ds As
> DataSet) As Boolean
> Try
> Dim strConn As String = "Provider=Microsoft.Jet.OLEDB.4.0; Data
> Source=" & FileName & "; Extended Properties=Excel 8.0;"
> Dim objConn As New System.Data.OleDb.OleDbConnection(strConn)
> objConn.Open()
> ' Create objects ready to grab data
> Dim objCmd As New System.Data.OleDb.OleDbCommand("SELECT * FROM
> [sheet1$]", objConn)
> Dim objDA As New System.Data.OleDb.OleDbDataAdapter
> objDA.SelectCommand = objCmd
> ' Fill DataSet
> objDA.Fill(ds)
> ' Clean up and return
> objConn.Close()
> Return True
> Catch ex As Exception
> lblHeading.Text = ex.ToString
> Return False
> End Try
> End Function
> When I run my ASPX on my own PC it runs fine and does what it must do.
> When I put the page on the server I get this message:
> System.Data.OleDb.OleDbException: Unspecified error at
> System.Data.OleDb.OleDbConnection.ProcessResults(I nt32 hr) at
> System.Data.OleDb.OleDbConnection.InitializeProvid er() at
> System.Data.OleDb.OleDbConnection.Open() at
> FSsite.FSsite.WebFormSubmit.GetDataFromExcel(Strin g FileName, DataSet ds)
> Now I copied to System.Data.OleDb.dll file to the BIN folder at the IIS
> webserver, but is there anything else I should do?
> Can anyone explain to me what this means, it's a little vage error
> message?
> thanks,
> Eric

OleDbConnection - cannot read Excel file

I have the following code in an asp.net page:

System.Data.OleDb.OleDbConnection cn = new
System.Data.OleDb.OleDbConnection();
cn.ConnectionString = @dotnet.itags.org."Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=\\myservername\ExcelTemp\Temp.xls;Extended Properties=Excel
8.0";
cn.Open();
cn.Close();

My IIS site (on localhost) is set to not allow anonymous users,
integrated security. My web.config has the following for impersonation:

<identity impersonate="true" userName="mydomain\workerprocess"
password="mypassword" /
When running this page, I get the helpful
System.Data.OleDb.OleDbException: Unspecified error. There is no record
in the security Event Log of MyServerName that access was attempted.

When I change web.config to:
<identity impersonate="true" /
I get: System.Data.OleDb.OleDbException: The Microsoft Jet database
engine cannot open the file '\\myservername\ExcelTemp\Temp.xls'. It is
already opened exclusively by another user, or you need permission to
view its data.

The security event log records four back-to-back login success audits
coming from my computer, but the user is ANONYMOUS LOGIN. For example:

Event Type:Success Audit
Event Source:Security
Event Category:Logon/Logoff
Event ID:540
Date:5/12/2006
Time:1:43:31 PM
User:NT AUTHORITY\ANONYMOUS LOGON
Computer:MYSERVERNAME
Description:
Successful Network Logon:
User Name:
Domain:
Logon ID:(0x0,0xA685FE4E)
Logon Type:3
Logon Process:NtLmSsp
Authentication Package:NTLM
Workstation Name:MYCOMPUTERNAME
Logon GUID:-
Caller User Name:-
Caller Domain:-
Caller Logon ID:-
Caller Process ID: -
Transited Services: -
Source Network Address:10.0.100.100
Source Port:0

Any ideas how to actually pass the identity being impersonated through
the OleDbConnection? This application reads several SQL Server
databases and everything is working just fine. But I need to read an
Excel file and can't get it to work. Any help would be greatly
appreciated.As with Access databases, a TEMP directory being used. The account under
which the web site is running will probably need full access to the "TEMP"
directory being used. It may be the one under "documents and
settings"\<machinename>\ASPNET\"Local Settings"\Temp...

--
Brad

"Software is like melted pudding..."
Brad, your suggestion worked. Thank you so much for your help.

Talk about misleading error messages...

Dave

OleDbConnection - cannot read Excel file

I have the following code in an asp.net page:
System.Data.OleDb.OleDbConnection cn = new
System.Data.OleDb.OleDbConnection();
cn.ConnectionString = @dotnet.itags.org."Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=\\myservername\ExcelTemp\Temp.xls;Extended Properties=Excel
8.0";
cn.Open();
cn.Close();
My IIS site (on localhost) is set to not allow anonymous users,
integrated security. My web.config has the following for impersonation:
<identity impersonate="true" userName="mydomain\workerprocess"
password="mypassword" />
When running this page, I get the helpful
System.Data.OleDb.OleDbException: Unspecified error. There is no record
in the security Event Log of MyServerName that access was attempted.
When I change web.config to:
<identity impersonate="true" />
I get: System.Data.OleDb.OleDbException: The Microsoft Jet database
engine cannot open the file '\\myservername\ExcelTemp\Temp.xls'. It is
already opened exclusively by another user, or you need permission to
view its data.
The security event log records four back-to-back login success audits
coming from my computer, but the user is ANONYMOUS LOGIN. For example:
Event Type: Success Audit
Event Source: Security
Event Category: Logon/Logoff
Event ID: 540
Date: 5/12/2006
Time: 1:43:31 PM
User: NT AUTHORITY\ANONYMOUS LOGON
Computer: MYSERVERNAME
Description:
Successful Network Logon:
User Name:
Domain:
Logon ID: (0x0,0xA685FE4E)
Logon Type: 3
Logon Process: NtLmSsp
Authentication Package: NTLM
Workstation Name: MYCOMPUTERNAME
Logon GUID: -
Caller User Name: -
Caller Domain: -
Caller Logon ID: -
Caller Process ID: -
Transited Services: -
Source Network Address: 10.0.100.100
Source Port: 0
Any ideas how to actually pass the identity being impersonated through
the OleDbConnection? This application reads several SQL Server
databases and everything is working just fine. But I need to read an
Excel file and can't get it to work. Any help would be greatly
appreciated.As with Access databases, a TEMP directory being used. The account under
which the web site is running will probably need full access to the "TEMP"
directory being used. It may be the one under "documents and
settings"\<machinename>\ASPNET\"Local Settings"\Temp...
Brad
"Software is like melted pudding..."
Brad, your suggestion worked. Thank you so much for your help.
Talk about misleading error messages...
Dave

OleDbConnection is not defined.

Hi!
I get the following error when connecting to my database. What am I missing? Please help, its driving me crazy!

Compiler Error Message:BC30002: Type 'OleDbConnection' is not defined.
Source Error:
Line 10: Dim objConnection As OleDbConnection

This is my code:
<%@dotnet.itags.org. Page Language="VB" %>
<%@dotnet.itags.org. import Namespace="System" %>
<%@dotnet.itags.org. import Namespace="System.Data" %>
<%@dotnet.itags.org. import Namespace="Sysyem.Data.OleDb" %>
<script runat="server">
    Sub Page_Load(Source As Object, E As EventArgs)
Dim objConnection As OleDbConnection = New OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0; DATA SOURCE=C:\..\foods.mdb")
objConnection.Open()
...
Add this to the top of you code behind page...

Imports System.Data.OleDb

Oopps, just looked closer at your code... nevermind.
You must not be using VS.Net.
You have it imported and it should work.

Zath


Nope, no VS.NET for me! I'm using webmatrix. I thought it should work, is there something I could be leaving out - like setting it up through ODBC administrator?
Crab


Crab wrote:

This is my code:
<%@. Page Language="VB" %>
<%@. import Namespace="System" %>
<%@. import Namespace="System.Data" %>
<%@. import Namespace="Sysyem.Data.OleDb" %>


You've misspelled the namespace. Try
System.Data.OleDb

Good catch. I didn't even notice that.....
Doh! I can't believe how many times I read over that and didn't see it. Thanks!
Doh! I can't believe how many times I read over that and didn't see it. Thanks!
Now I have a problem with my datareader! any more help?
Compiler Error Message:BC30201: Expression expected.
Source Error:
Line 22: & "</b></td><td>" & objDataReader("Weight") & "</td><td>" _Line 23: & objDataReader("Price") & "</td></tr>" & _Line 24: & "<tr><td colspan='3'>" & objDatareader("Description") _Line 25: & "</td></tr>"Line 26: Loop

Did you check whether you have null values into your Description column? Another way is allowing null values against that column

There are no null values in any of the columns used. I can't work it out.


Can we see more of your code? I am curious why you are outputting your data in that manner.

S'ok, it was an extra & at the end of line 23. I'm doing an exercise from as asp.net book that was using the datarepeater to display the datasource.
Thanks for your help!

OleDbConnection via MS REMOTE -> "Specified cast is not valid. "

Hi everyone,
Im using the following conn string in asp.net 1.1 using vb.net:
Dim conn As New OleDbConnection("Provider=MS Remote;Remote
Server=http://myintranetserver/; Remote Provider=Microsoft.Jet.OLEDB.
4.0;Data Source=c:\pass\be\quiz.mdb;uid=;Password=;")
Whenever I execute rs.executereader,
I will receive "Specified cast is not valid. "
There's nothing wrong with the sql statements.
if i change my conn string to:
' Dim conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.
4.0;Data Source=c:\pass\be\quiz.mdb;User Id=admin;Password=;")
Then the script will have no problem!
Pls advise.,
Thanksif the server is on the same network - instead of the Http://, use a UNC
format in the path, like:
\\Servername\yourpath\your.mdb
David Wier
MVP/ASPInsider
http://aspnet101.com
http://iWritePro.com
"user" <mylinuxjourney@.gmail.com> wrote in message
news:1181215727.462820.245670@.g37g2000prf.googlegroups.com...
> Hi everyone,
> Im using the following conn string in asp.net 1.1 using vb.net:
> Dim conn As New OleDbConnection("Provider=MS Remote;Remote
> Server=http://myintranetserver/; Remote Provider=Microsoft.Jet.OLEDB.
> 4.0;Data Source=c:\pass\be\quiz.mdb;uid=;Password=;")
> Whenever I execute rs.executereader,
> I will receive "Specified cast is not valid. "
> There's nothing wrong with the sql statements.
> if i change my conn string to:
> ' Dim conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.
> 4.0;Data Source=c:\pass\be\quiz.mdb;User Id=admin;Password=;")
> Then the script will have no problem!
> Pls advise.,
> Thanks
>
THanks for the reply.
Do u mind elaborate further? Or post the full conn string?
Thanks
On Jun 7, 10:44 pm, "David Wier" <davidw...@.davidwier.nospam.com>
wrote:
> if the server is on the same network - instead of the Http://, use a UNC
> format in the path, like:
> \\Servername\yourpath\your.mdb
> --
> David Wier
> MVP/ASPInsiderhttp://aspnet101.comhttp://iWritePro.com
> "user" <mylinuxjour...@.gmail.com> wrote in message
> news:1181215727.462820.245670@.g37g2000prf.googlegroups.com...
>
>
>
>
>
>
>
>
>
>
>
> - Show quoted text -

OleDbConnection via MS REMOTE -> "Specified cast is not valid. "

Hi everyone,

Im using the following conn string in asp.net 1.1 using vb.net:

Dim conn As New OleDbConnection("Provider=MS Remote;Remote
Server=http://myintranetserver/; Remote Provider=Microsoft.Jet.OLEDB.
4.0;Data Source=c:\pass\be\quiz.mdb;uid=;Password=;")

Whenever I execute rs.executereader,

I will receive "Specified cast is not valid. "

There's nothing wrong with the sql statements.

if i change my conn string to:
' Dim conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.
4.0;Data Source=c:\pass\be\quiz.mdb;User Id=admin;Password=;")

Then the script will have no problem!

Pls advise.,

Thanksif the server is on the same network - instead of the Http://, use a UNC
format in the path, like:
\\Servername\yourpath\your.mdb

--
David Wier
MVP/ASPInsider
http://aspnet101.com
http://iWritePro.com
"user" <mylinuxjourney@.gmail.comwrote in message
news:1181215727.462820.245670@.g37g2000prf.googlegr oups.com...

Quote:

Originally Posted by

Hi everyone,
>
Im using the following conn string in asp.net 1.1 using vb.net:
>
Dim conn As New OleDbConnection("Provider=MS Remote;Remote
Server=http://myintranetserver/; Remote Provider=Microsoft.Jet.OLEDB.
4.0;Data Source=c:\pass\be\quiz.mdb;uid=;Password=;")
>
Whenever I execute rs.executereader,
>
I will receive "Specified cast is not valid. "
>
There's nothing wrong with the sql statements.
>
if i change my conn string to:
' Dim conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.
4.0;Data Source=c:\pass\be\quiz.mdb;User Id=admin;Password=;")
>
Then the script will have no problem!
>
Pls advise.,
>
Thanks
>


THanks for the reply.

Do u mind elaborate further? Or post the full conn string?
Thanks

On Jun 7, 10:44 pm, "David Wier" <davidw...@.davidwier.nospam.com>
wrote:

Quote:

Originally Posted by

if the server is on the same network - instead of the Http://, use a UNC
format in the path, like:
\\Servername\yourpath\your.mdb
>
--
David Wier
MVP/ASPInsiderhttp://aspnet101.comhttp://iWritePro.com
>
"user" <mylinuxjour...@.gmail.comwrote in message
>
news:1181215727.462820.245670@.g37g2000prf.googlegr oups.com...
>
>
>

Quote:

Originally Posted by

Hi everyone,


>

Quote:

Originally Posted by

Im using the following conn string in asp.net 1.1 using vb.net:


>

Quote:

Originally Posted by

Dim conn As New OleDbConnection("Provider=MS Remote;Remote
Server=http://myintranetserver/;Remote Provider=Microsoft.Jet.OLEDB.
4.0;Data Source=c:\pass\be\quiz.mdb;uid=;Password=;")


>

Quote:

Originally Posted by

Whenever I execute rs.executereader,


>

Quote:

Originally Posted by

I will receive "Specified cast is not valid. "


>

Quote:

Originally Posted by

There's nothing wrong with the sql statements.


>

Quote:

Originally Posted by

if i change my conn string to:
' Dim conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.
4.0;Data Source=c:\pass\be\quiz.mdb;User Id=admin;Password=;")


>

Quote:

Originally Posted by

Then the script will have no problem!


>

Quote:

Originally Posted by

Pls advise.,


>

Quote:

Originally Posted by

Thanks- Hide quoted text -


>
- Show quoted text -

OleDbException: Too many arguments.

Hi,

I'm passing around 30 arguments to a stored procedure, and
I got the following error (see below).
It works fine if I narrow down to around 25 args. Is there
any workaround to bypass this exception, I need to pass 30
of them to my stored procedure. Thanks.
I'm using Framework 1.0.

--------
Too many arguments.
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.OleDb.OleDbException: Too
many arguments.

Source Error:

Line 663:
Line 664: 'execute SQL
Line 665: oCmd.ExecuteNonQuery()
Line 666:
Line 667: 'Catch exc As OleDbException
--------If you have any return parameters, they must be specified first. You should
declare any return parameters before you start adding input parameters. That
is commonly the reason for this error. Also, make sure that the order in
which you are adding your parameters match the order in the stored
procedure.

HTH,
Bill P.

"jn" <anonymous@.discussions.microsoft.com> wrote in message
news:001001c3aec9$13cedf10$a501280a@.phx.gbl...
> Hi,
> I'm passing around 30 arguments to a stored procedure, and
> I got the following error (see below).
> It works fine if I narrow down to around 25 args. Is there
> any workaround to bypass this exception, I need to pass 30
> of them to my stored procedure. Thanks.
> I'm using Framework 1.0.
> --------
> Too many arguments.
> 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.OleDb.OleDbException: Too
> many arguments.
> Source Error:
>
> Line 663:
> Line 664: 'execute SQL
> Line 665: oCmd.ExecuteNonQuery()
> Line 666:
> Line 667: 'Catch exc As OleDbException
> --------
arg, I found out it's Visual FoxPro problem (I'm using VFP
as the backend database), it just won't take more than 28
parameters. Thanks, Bill, for looking into my problem
though.

>--Original Message--
>If you have any return parameters, they must be specified
first. You should
>declare any return parameters before you start adding
input parameters. That
>is commonly the reason for this error. Also, make sure
that the order in
>which you are adding your parameters match the order in
the stored
>procedure.
>HTH,
>Bill P.
>
>"jn" <anonymous@.discussions.microsoft.com> wrote in
message
>news:001001c3aec9$13cedf10$a501280a@.phx.gbl...
>> Hi,
>>
>> I'm passing around 30 arguments to a stored procedure,
and
>> I got the following error (see below).
>> It works fine if I narrow down to around 25 args. Is
there
>> any workaround to bypass this exception, I need to pass
30
>> of them to my stored procedure. Thanks.
>> I'm using Framework 1.0.
>>
>> --------
>> Too many arguments.
>> 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.OleDb.OleDbException: Too
>> many arguments.
>>
>> Source Error:
>>
>>
>> Line 663:
>> Line 664: 'execute SQL
>> Line 665: oCmd.ExecuteNonQuery()
>> Line 666:
>> Line 667: 'Catch exc As OleDbException
>> --------
>>
>
>.