|
Hi All,
I receive this error when I tried to run my webapp using IIS.
Error:
Access is denied.
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.Runtime.InteropServices.COMException: Access is denied.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[COMException (0x80004005): Access is denied.
]
CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.Open(Object& DocumentPath, Int32 Options) +0
CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.Open(Object& DocumentPath, Int32 Options) +95
CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened() +271
[CrystalReportsException: Load report failed.]
Reports_ReportCVIEWNow.btnProceed_Click(Object sender, EventArgs e) +1418
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
I am testing my application on IIS Server, it was ok when I run it on the test server that came with Visual Studio, but when I moved the code to Inetpub, it cause an error.
Any help regarding this will be greatly appreciated...
Thanks a lot in advance
Strive For Excellence not Perfection..!!!
|
|
|
|
|
Check if the user under which the worker process is running has access to the folder where you have the report file.
|
|
|
|
|
Got the solution...!!
We have to specify userName and password attributes in the <identity> tag of the Web.config file for identifying the IIS Authenticated Account or User
For example:
<identity impersonate="true" userName="accountname" password="password" />
Thanks for your help...!!!Strive For Excellence, not Perfection
|
|
|
|
|
Hello out there.
I will pay $20,000 to anyone who can give me the password colors, user name and encoding phrases that gives you access to the page where you can claim the prize.
To claim the prize you must get to the claim page and email the value which will be exposed if you are successful.
This is a Genuine challenge, there are no tricks or gimmicks.
You can create accounts to test the system, you can also test the forgot password feature.
Website address is www.securebycolor.com[^]
Good luck to those that want to take the challenge.
|
|
|
|
|
Hi,
I'm creating a datagrid control in asp.net on the fly. I have bound the datagrid to a sql database and I'm able to get values for rows and columns.
I want to create links for one the columns. These will be links on a share, exmaple \\server1\folder1\file1. When I click on the link, I want to show a File Download dialog.
I have tried many options, looked on the web, but couldn't find the exact solution. People have mentioned about HyperlinkColumn - but I don't have a link to webpage. I also tried to setup a OnClick event and used javascript but unable to invoke the File Download dialog.
Any help on this topic is much appreciated.
Thanks!
|
|
|
|
|
Use a normal html link tag to create a link using a template column. Set the URL property for the link to point to the document. Note that the document must be a part of a webfolder, a shared folder alone will not do. Just create a dummy website based on the shared folder location and give the URL there. Make sure you set the target to "_blank" .
Now, when the users click on the link your document will open, if that's the default action the they have set for the document type. Else it will show the Open/Save dialog.
HTH!
|
|
|
|
|
Thanks Dinesh. I'm able to create the column, but it is blank, there is no data. All other non-link columns have correct data. Are there any code samples that I could use to get around this obstacle?
Thanks
|
|
|
|
|
Never mind. I got it working. The data for the link was not showing up in e.item.cells[1].text, I had to retrieve it using ItemArray. But now, when I click on the link, nothing shows up. Do I need an OnClick event or something?
|
|
|
|
|
I got it to work by using a linkbutton instead of using the hyperlink. Also, files outside web folder can be downloaded using the response object. thanks for your help though..
|
|
|
|
|
Couldn't stay with you through your RnD. Anyway good to know that you got it working and glad that I was able to point you in the right direction.
|
|
|
|
|
Yes, thanks for pointing me in the correct direction..
|
|
|
|
|
hello all..
i want to send email using the password recovery
using the yahoo or gmail server what can i do either in web config file and in the properties for password recovery...
to save time i will display what i get
in web config i have added this code
<system.net>
<mailSettings>
<smtp from="user@yahoo.com" deliveryMethod="Network">
<network host="smtp.mail.yahoo.com" password="password" port="465"
userName="user@yahoo.com" />
</smtp>
</mailSettings>
</system.net>
and in the desighner code i have this
<asp:PasswordRecovery ID="PasswordRecovery1" runat="server"
<MailDefinition BodyFileName="~/EmailTemplate/PasswordRecovery.txt"
Subject="your password has been reset...">
</MailDefinition>
please any comments i need it..
|
|
|
|
|
Hi
I am new to web development. I am developing two pages for user registration.
first page storing the information in user table with email as a primary key. email column from user table is a foreign key in address table.
On second registration page I am trying to store address. But I don't know how to map the values with email column which is a foreign key in address table. Please help me out.
Regards
|
|
|
|
|
I think you are talking about holding the page state.
There are lots of options you have to maintain the page state. But as the key is very small, you can go for Session.
Use
Session.Add("pkey", yourkey);
Now from the second page:
string mykey = Session["pkey"] as string;
I think you will find the data that is stored during submission of Page 1.
|
|
|
|
|
thanks Abhishek
its working
cheers
|
|
|
|
|
Hi,
I need to know how use the field "from" to send an email.
I think once i created the object mapi, like private Mapi ma= new Mapi(); one of the methods is SetSender(string name,string addr), but when I send the email allways shows me email account.
Here is my code (Windows Application C#):
http://i49.tinypic.com/il8zkw.jpg
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Win32Mapi;
namespace MailMapi
{
public partial class Form1 : Form
{
private Mapi ma = new Mapi();
// private bool first_activated = false;
// private Font boldFont;
// MailEnvelop currentMail;
// MailComparer comparer = new MailComparer();
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void bf_Click(object sender, EventArgs e)
{
string name; string addr;
if (ma.SingleAddress(null, out name, out addr))
tf.Text = name;
ma.SetSender(tf.Text, null);
}
private void bt_Click(object sender, EventArgs e)
{
string name; string addr;
if (ma.SingleAddress(null, out name, out addr))
tto.Text = name;
}
private void bcc_Click(object sender, EventArgs e)
{
string name; string addr;
if (ma.SingleAddress("CC", out name, out addr))
tcc.Text = name;
}
private void bsend_Click(object sender, EventArgs e)
{
string ssubject ="**"+cbapp.Text+" code n°"+tbinc.Text;
string sbody="Dear "+tbclt.Text+",";
sbody+="\n\tbody.Text;
sbody += ssign;
ma.AddRecip(tto.Text, null, false);
if (tcc.Text != null)
{
if (tcc.Text.Length > 0)
ma.AddRecip(tcc.Text, null, true);
}
if (!ma.Send(ssubject, sbody))
MessageBox.Show(this, "MAPISendMail failed! " + ma.Error(), "Send Mail", MessageBoxButtons.OK, MessageBoxIcon.Warning);
ma.Reset();
}
}
}
|
|
|
|
|
Hi, I've an asp:calendar, I would like to highlight a date for an event on it.
For example: on 18th april 2010, I wish the date was highlighted, and when the mouse passes over I want that appear the description of the event(eg:"Tonight live concert")!
How do I proceed? Help me!
|
|
|
|
|
For highlighting a day, you have to attach OnDayRender event to your calendar.This will be called for all the dates visible in the calendar.You need to check the date in this function and add the style as you want.You can also show the description as tooltip as below
e.Cell.ToolTip = "Tonight live concert";
Let me know if you have any query.
Also you can go through a good article on the same topic Click hereCheers!!
Brij
|
|
|
|
|
|
I'm working on a database-driven food pantry application which will allow a user to add a new household to the database. The user would theoretically add members to this household by using a modal popup form to add a new family member by either entering new information in a form, or search for a person who is already in the system but is not assigned to a household. The new family member would be added to a datable which is then databinded to a gridview. When the household information is saved, we theoretically add everyone in the datable to the newly created household by changing their HHID (the foreign key in the database linking them to the database) to that of the newly created household. It makes use of Ajax update panels to dynamically add data without reloading the page.
Now here is where the problem comes into play: when the user adds the new family member (either by searching or entering new data), the datatable is cleaned out, and only the newly created family member shows up. My code is as follows:
This function is what actually puts the data into the datatable.
protected void AddNewFamilyMemberToDatatable(string SSN, string First, string Last, string DOB, string AdultChild, string Gender, bool Head, String ConsentForm, string Ethnicity)
{
FamilyWarning.Text += "<br/>There are now" + NewHouseholdDatatable.Rows.Count.ToString() + " rows in the table before adding empty columns and after getting changes";
AddEmptyColumnsToDatatable(NewHouseholdDatatable);
FamilyWarning.Text += "<br/>There are now" + NewHouseholdDatatable.Rows.Count.ToString() + " rows in the table after adding empty columsn";
FamilyWarning.Text += "<br/>There are now" + NewHouseholdDatatable.Rows.Count.ToString() + " rows in the table after assigning datasource";
DataRow Row = NewHouseholdDatatable.NewRow();
if (Head)
{
Row["HeadOfHousehold"] = true;
}
else
{
Row["HeadOfHousehold"] = false;
}
Row["Firstname"] = First;
Row["DOB"] = DOB;
Row["Lastname"] = Last;
Row["SSN"] = SSN;
Row["AdultChild"] = AdultChild;
Row["MaleFemale"] = Gender;
if (ConsentForm == "1")
{ Row["ConsentForm"] = true; }
else
{ Row["ConsentForm"] = false; }
Row["Ethnicity"] = Ethnicity;
if (!CheckIsDate(DOB))
{
Row["Age"] = 0;
Row["DateOfBirth"] = "Unknown, please edit and enter proper data";
}
else
{
Row["Age"] = GetAge(DateTime.Parse(DOB));
DateTime DateAndTimeOfBirth = Convert.ToDateTime(DOB);
Row["DateOfBirth"] = DateAndTimeOfBirth.ToShortDateString();
}
try
{
FamilyWarning.Text += "<br/>There are " + NewHouseholdDatatable.Rows.Count.ToString() + " rows in the table before adding";
NewHouseholdDatatable.Rows.Add(Row);
FamilyWarning.Text += "<br/>There are now" + NewHouseholdDatatable.Rows.Count.ToString() + " rows in the table after accepting changes";
ClearForm();
FamilyMembers.DataSource = NewHouseholdDatatable;
FamilyMembers.DataBind();
FamilyWarning.Text += "<br/>There are now" + NewHouseholdDatatable.Rows.Count.ToString() + " rows in the table after databinding";
}
catch (Exception ex)
{
FamilyWarning.Text += "<br/>Unable to add this person to the table, " + ex.Message;
}
}
|
|
|
|
|
I guess AddEmptyColumnsToDatatable(NewHouseholdDatatable); something wrong is going on.
please put a breakpoint on the line and see if after executing this line, the Datatable remains the same.
|
|
|
|
|
That didn't work. Here is the code to the add empty columns function though
protected void AddEmptyColumnsToDatatable(DataTable datatable)
{
if (!datatable.Columns.Contains("HeadOfHousehold"))
{
DataColumn HeadOfHousehold = new DataColumn("HeadOfHousehold", Type.GetType("System.Boolean"));
datatable.Columns.Add(HeadOfHousehold);
}
if (!datatable.Columns.Contains("Age"))
{
DataColumn Age = new DataColumn("Age", Type.GetType("System.Int32"));
datatable.Columns.Add(Age);
}
if (!datatable.Columns.Contains("DateOfBirth"))
{
DataColumn DateOfBirth = new DataColumn("DateOfBirth", Type.GetType("System.String"));
datatable.Columns.Add(DateOfBirth);
}
if (!datatable.Columns.Contains("Firstname"))
{
DataColumn DateOfBirth = new DataColumn("Firstname", Type.GetType("System.String"));
datatable.Columns.Add(DateOfBirth);
}
if (!datatable.Columns.Contains("Lastname"))
{
DataColumn DateOfBirth = new DataColumn("Lastname", Type.GetType("System.String"));
datatable.Columns.Add(DateOfBirth);
}
if (!datatable.Columns.Contains("SSN"))
{
DataColumn DateOfBirth = new DataColumn("SSN", Type.GetType("System.String"));
datatable.Columns.Add(DateOfBirth);
}
if (!datatable.Columns.Contains("DOB"))
{
DataColumn DateOfBirth = new DataColumn("DOB", Type.GetType("System.String"));
datatable.Columns.Add(DateOfBirth);
}
if (!datatable.Columns.Contains("AdultChild"))
{
DataColumn DateOfBirth = new DataColumn("AdultChild", Type.GetType("System.String"));
datatable.Columns.Add(DateOfBirth);
}
if (!datatable.Columns.Contains("MaleFemale"))
{
DataColumn DateOfBirth = new DataColumn("MaleFemale", Type.GetType("System.String"));
datatable.Columns.Add(DateOfBirth);
}
if (!datatable.Columns.Contains("ConsentForm"))
{
DataColumn DateOfBirth = new DataColumn("ConsentForm", Type.GetType("System.Boolean"));
datatable.Columns.Add(DateOfBirth);
}
if (!datatable.Columns.Contains("Ethnicity"))
{
DataColumn DateOfBirth = new DataColumn("Ethnicity", Type.GetType("System.String"));
datatable.Columns.Add(DateOfBirth);
}
}
|
|
|
|
|
Nevermind, I solved it. My problem was that whenever I did an Ajax postback, the entire table would be lost, not emptied. So all I had to do was copy it to a viewstate, and then reload it from the viewstate. It goes as follows:
NewHouseholdDatatable = new DataTable();
AddEmptyColumnsToDatatable(NewHouseholdDatatable);
Then I changed my adding code to the following:
protected void AddNewFamilyMemberToDatatable(string SSN, string First, string Last, string DOB, string AdultChild, string Gender, bool Head, String ConsentForm, string Ethnicity)
{
if (ViewState["NewHouseholdDatatable"] != null)
{
NewHouseholdDatatable = (DataTable)ViewState["NewHouseholdDatatable"];
AddEmptyColumnsToDatatable(NewHouseholdDatatable);
}
else
{
NewHouseholdDatatable = new DataTable();
AddEmptyColumnsToDatatable(NewHouseholdDatatable);
}
FamilyWarning.Text += "<br/>There are now" + NewHouseholdDatatable.Rows.Count.ToString() + " rows in the table after adding empty columsn";
FamilyWarning.Text += "<br/>There are now" + NewHouseholdDatatable.Rows.Count.ToString() + " rows in the table after assigning datasource";
DataRow Row = NewHouseholdDatatable.NewRow();
if (Head)
{
Row["HeadOfHousehold"] = true;
}
else
{
Row["HeadOfHousehold"] = false;
}
Row["Firstname"] = First;
Row["DOB"] = DOB;
Row["Lastname"] = Last;
Row["SSN"] = SSN;
Row["AdultChild"] = AdultChild;
Row["MaleFemale"] = Gender;
if (ConsentForm == "1")
{ Row["ConsentForm"] = true; }
else
{ Row["ConsentForm"] = false; }
Row["Ethnicity"] = Ethnicity;
if (!CheckIsDate(DOB))
{
Row["Age"] = 0;
Row["DateOfBirth"] = "Unknown, please edit and enter proper data";
}
else
{
Row["Age"] = GetAge(DateTime.Parse(DOB));
DateTime DateAndTimeOfBirth = Convert.ToDateTime(DOB);
Row["DateOfBirth"] = DateAndTimeOfBirth.ToShortDateString();
}
try
{
FamilyWarning.Text += "<br/>There are " + NewHouseholdDatatable.Rows.Count.ToString() + " rows in the table before adding";
NewHouseholdDatatable.Rows.Add(Row);
FamilyWarning.Text += "<br/>There are now" + NewHouseholdDatatable.Rows.Count.ToString() + " rows in the table after accepting changes";
ClearForm();
ViewState["NewHouseholdDatatable"] = NewHouseholdDatatable;
FamilyMembers.DataSource = NewHouseholdDatatable;
FamilyMembers.DataBind();
FamilyWarning.Text += "<br/>There are now" + NewHouseholdDatatable.Rows.Count.ToString() + " rows in the table after databinding";
}
catch (Exception ex)
{
FamilyWarning.Text += "<br/>Unable to add this person to the table, " + ex.Message;
}
}
|
|
|
|
|
sir,
i want to bind records to a datalist control. i want to show records when any user clicks on a button named btnShowRec_Click().
..i wrote a piece of code below but it is not showing records at runtime
protected void btnShowRec_Click(object sender, EventArgs e)
{
if (!IsPostBack)
{
string sqlgrid = "select * from ebay where category='" + ddlCatg.SelectedItem.Value + "'";
cmd = new SqlCommand(sqlgrid, conn);
conn.Open();
dtlstEbay.DataSource = cmd.ExecuteReader();
dtlstEbay.DataBind();
conn.Close();
conn.Dispose();
}
dtlstEbay is the name of data list control.i have also binded with #Eval with each column in source page but not getting desirable output..
|
|
|
|
|
IsPostBack evaluates to true if the page is posted back from the client. In fact, in your case you want when the button is clicked, you need to bind data.
Thus in your case IsPostBack will evaluates to true. !IsPostBack will be false.
Hence the entire code will be bypassed.
|
|
|
|
|