C# - IIS 7.5 Fails When Accessing DB?
Dec 18, 2010
I have a simple WCF service that retrieves some data from the DB. When I host the service on local serviceHost everything works fine, but when I host the same service on local IIS (7.5 - windows 7) I get this exception: The Undelying provider failed on open.
I have some logging services inside the service and I found out that this exception occures only when the service calls some DB service (not one particular, any DB service). The strange thing is that when the service is not hosted on IIS this same DB call works fine.
Things I've done: enabled ASP.NET impersonation on the IIS server -> didn't help.
Another thing : I'm using sql server 2008 express.
View 5 Replies
Similar Messages:
Mar 21, 2011
While running an app from the server where it is deployed the website works fine, however when trying to access it from a different machine(placed in same network), using the same credentials, it shows that I am not an authenticated user.
[code]....
View 13 Replies
Oct 6, 2010
To me this should be much easier, but I can't seem to retain the values that are put in the Insert template upon a validation failure or when the sql fails. This will prevent the user from having to retype everything agin in the event of a failure.
As you can see I am using the Sub Insert_Click and not using an insert through the wizard. so the fields are unbound textboxes on the form. There are 2 dropdowns that provide choices for the other fields.
I pasted in the code using the text only option becuase the format was getting messed up. I probably need more background on why the fields are blanking out.
[code]....
View 8 Replies
Feb 5, 2010
The following message appears in our log:The control tree into which viewstate is being loaded must match the control tree that was used to save viewstate during the previous request. For example, when adding controls dynamically, the controls added during a post-back must match the type and position of the controls added during the initial request. alot has been written about this subject. However, I cannot reproduce this behavior, and I only find a couple thousand errors per day in the logs; so it's probably isn't that obvious.
The page in question has an UpdatePanel and loads one of three usercontrols depending on the querystring.Is there any known issue with some clients, or any other possible explanation?
View 2 Replies
Jun 3, 2010
We are using RDLC's in a Asp.net web application. For reasons beyond our understanding, the first call to the database server fails with the following error:
An error has occurred during report processing. Cannot open database "TryParkingIt2" requested by the login. The login failed. Login failed for user 'EXTRANETOurServerNameHere$'.
Run the report again, it works.
Update Click the button the first time, it fails. Click the button again, it works. The account being impersonated is a domain account. Also, this error occurs on all five different report pages, which is why I didn't include any code.
View 1 Replies
Aug 12, 2010
I am using MVC 2 Model Validation together withLocalization. For some strange reason, everything works fine except for one translation, namely the word "Password". It should change into "Wachtwoord", the Dutch term, but it doesn't. I checked everything and I can't find what's wrong.So, there's the AccountModels.cs file, containing the class RegisterModel (which is the basis for the view file and validation). It looks like this:
[Code]....
Obviously, there is also a Names.resx file which contains all the aforementioned "LocalizedDisplayName" elements:The Register.aspx file reads from this model:
[Code]....
The HTML output is like:As you can see, everything gets translated correctly, except for "Password".
View 2 Replies
Sep 26, 2010
Here is the code first :
Const localFile As String = "C:file.bin"
View 4 Replies
Jul 6, 2010
I have the following config for roles using standard SqlRoleProvider, but I get an error when I try and open the Security page in the wweb site Admin tool:
<roleManager enabled="true" defaultProvider="AspNetSqlRoleProvider">
<providers>
<remove name="AspNetSqlRoleProvider"/>
<add name="AspNetSqlRoleProvider"
type="System.Web.Security.SqlRoleProvider"
connectionStringName="PoyntingInstallationConnectionString"
applicationName="/" />
</providers>
</roleManager>
The DB has all the role tables etc.
View 1 Replies
Apr 16, 2010
What does this mean and how can I correct it?Cannot open database "myDATABASE" requested by the login. The login failed.Login failed for user 'NT AUTHORITYNETWORK SERVICE'. I'm using SQL Server 2008 EXPRESS and Visual Web Developer 2008
View 2 Replies
Feb 12, 2010
why this update is failing? The table is connected to OK and there are appropriate values in the parameters to the subroutine, and yet the record in the table remains unchanged. I am using exactly the same code (with different parameters, obviously) to update another table and this continues to work fine.
Public Shared Sub SaveMathsSettingOptions(ByVal ID As Integer, ByVal Auto As String, ByVal Repeats As Integer, ByVal Weekly As String, ByVal ClassSheets As Integer, ByVal HomeSheets As Integer)
Dim con As New MySqlConnection(_connectionString)
Dim ret As String
Dim sql As String
sql = "UPDATE centres SET maths_auto = @maths_auto, maths_auto_reps = @maths_auto_reps, maths_weekly = @maths_weekly, maths_class_sheets = @maths_class_sheets, maths_home_sheets = @maths_home_sheets WHERE centreID = @centreID"
Dim cmd As New MySqlCommand(sql, con)
cmd.Parameters.AddWithValue("@maths_auto", Auto)
cmd.Parameters.AddWithValue("@maths_auto_reps", Repeats)
cmd.Parameters.AddWithValue("@maths_weekly", Weekly)
cmd.Parameters.AddWithValue("@maths_class_sheets", ClassSheets)
cmd.Parameters.AddWithValue("@maths_home_sheets", HomeSheets)
cmd.Parameters.AddWithValue("@centreID", ID)
Try
con.Open()
Catch myerror As MySqlException
'MessageBox.Show("Error Connecting to Database: " & myerror.Message)
ret = myerror.Message
con.Close()
Finally
con.Dispose()
End Try
End Sub
View 11 Replies
May 7, 2010
Language-Asp.net(c#) 2008 Sql Server 2005 well i designed a simple login form which checks the user and password with sql server but now i want to make it a little bit more secured basically i want if a user attempts wrong password with more then 3 /5 times. his id or username should be locked(which i will be running a update procedure) or he must be redirect to denied.htm and one more thing he should be able to get only n only 3/5 attempts whether he opens firefox browser,internet explorer ,safari,google chrome or any other browser
View 6 Replies
Aug 30, 2010
I put a breakpoint on a Page_Load method for a .aspx page and I'm getting the following error when trying to run in debug mode:Quote:The breakpoint will not currently be hit. No symbols have been loaded for this document.I checked the "Modules" window and the DLL for this project is not listed there, but it does list all the DLLs for the other projects in the solution. I also checked web.config and verified that debug="true".
View 5 Replies
Feb 11, 2011
I have a series of parameters stored in rows in the database, and I'd like to return rows that satisfy both input parameters. The parameters come through in the URL, like "&msg_type=20560&status=101"
I have code that works fine, but only if there's one parameter. If there are two, it empties out the results. Here's my code:
[code]....
View 1 Replies
Dec 6, 2010
What is the best way to debug a CompareValidator that always fails the validation? Is there any way to see what the values are that it's comparing to maybe get a clue as to what's going wrong?
View 2 Replies
Sep 14, 2010
I am attempting to register my user controls within the webconfig file because I am receiving the Element does not exist error, but I am receiving the following error when I try to register them in webconfig:
Invalid or missing attributes found in the tagPrefix entry. For user control, you must also specify 'tagName' and 'src'. For custom control, you must also specify 'namespace', and optionally 'assembly'
The following is the code within the webconfig file:
<pages>
<controls>
<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, [code]....
The pages that are having this issue are also referencing MasterPages if that matters at all:
<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/programs/MasterProgram.master" CodeBehind="~/programs/wim2011/default.aspx" Inherits="IPAM.Website.programs.wim2011._default" %>
and they are each within their own folders.
View 1 Replies
Aug 5, 2010
I've got my e-mail health monitoring working fine (removed here) but when I try to get it into SQL Server it fails. When I run the stored procedure (aspnet_WebEvent_LogEvent) manualy it works OK. But nothing happens when I create an error (but I go get my health monitoring e-mail). What can I have missed?
View 1 Replies
Feb 12, 2011
I have created a C# registration page that includes a secret question and answer. The secret questions are in a dropdown list. When the form is submitted, all field information gets written to my mssql database successfully but the value selected in the dropdown ListItem gets NULL inserted instead of the question.
What am I missing? Here is my code.
[Code]....
View 1 Replies
Feb 15, 2011
i tried to use external assembly in my web service method (Web service is worked in LAN). This external assembly in their own internals use TcpClient to access to external IP address. But unfortunally. Creation of TcpClient fails.
System.Net.Sockets.SocketException was caught
Message=A socket operation has encountered a dead network xxx.xxx.xxx.xxx:xxxx
Source=System
ErrorCode=10050
[code]...
View 1 Replies
Nov 11, 2010
If have the below markup.
<asp:checkbox id="chkTVLic" runat="server" text="TV Licence" oncheckedchanged="chkDocs_CheckChanged"
autopostback="true" CausesValidation="false" />
<asp:panel id="pnlTVLic" runat="server" visible="false">
<div class="toggle-item-link1 document-date">
<asp:panel id="pnlTVLicIssueDate" runat="server">
<p>
Please enter the date of issue
</p>
<div class="fm-req">
<asp:textbox id="txtTVLicIssueDate" cssclass="tb size2" runat="server" onblur="return true;"></asp:textbox>
<cc2:calendarextender id="caleTVLicIssueDate" runat="server" targetcontrolid="txtTVLicIssueDate"
popupbuttonid="ibnTVLicIssueDate" popupposition="BottomLeft" animated="true"
format="dd/MM/yyyy">
</cc2:calendarextender>
<asp:imagebutton id="ibnTVLicIssueDate" runat="server" imageurl="../images/img-calendar-day.png"
alternatetext="Calendar" tooltip="Pick Date" cssclass="date-picker" />
<asp:requiredfieldvalidator id="rfvTVLicIssueDate" CssClass="error" runat="server" controltovalidate="txtTVLicIssueDate"
display="Dynamic" errormessage="Required" setfocusonerror="true" validationgroup="TVLic"></asp:requiredfieldvalidator>
<asp:comparevalidator id="cmvTVLicIssueDate" CssClass="error" runat="server" errormessage="Not a valid date"
controltovalidate="txtTVLicIssueDate" operator="DataTypeCheck" type="Date" setfocusonerror="true"
validationgroup="TVLic" display="Dynamic" cultureinvariantvalues="true"></asp:comparevalidator>
<asp:customvalidator id="cuvTVLicIssueDate12Months" CssClass="error" runat="server" controltovalidate="txtTVLicIssueDate"
validationgroup="TVLic" display="Dynamic" onservervalidate="cuvDocIssueDate12Months_ServerValidate"
errormessage="Document must be less than 12 months old."></asp:customvalidator>
</div>
</asp:panel>
<asp:panel id="pnlTVLicApprove" runat="server">
<asp:LinkButton id="lbnTVLicApprove" runat="server" CssClass="screen-hide"
alternatetext="Confirm TV Licence" tooltip="Confirm TV Licence" Text="OK" CausesValidation="false" OnClick="lbnApproveConfirm_Click" />
<asp:imagebutton id="ibnTVLicApprove" runat="server" imageurl="../images/img-accept-doc-off.png"
alternatetext="Approve" tooltip="Approve" cssclass="approval-btn" causesvalidation="true" validationgroup="TVLic" OnMouseDown="HandleApproveClick('TVLic','lbnTVLicApprove');return false;" OnClientClick="HandleApproveClick('TVLic','lbnTVLicApprove');return false;" />
<span class="approval-label">Accept document:</span></asp:panel>
</div>
</asp:panel>
The app is written in c# but i havn't posted any actual code as all the user code related to this markup seems to work fine.
The problem is the CheckBox chkTVLic has causes validation set to false and autopostback set to true. So whatever happens when i check and uncheck the checkbox it should postback. Most of the time this is exactly what it does and the result is to show and hide pnlTVLic when it is checked and unchecked. However if any on the validators within the panel fire, the checkbox does not cause a postback the first time. It will on all subsequent times but never the first. However it should ALWAYS cause a postback. What could be stopping it. Before someone asks there is no use written client side code, everything is pure .net markup and c# code.
View 1 Replies
Jan 20, 2010
We have a system in production, part of which is now failing. The failing part worked as follows:A user would upload a document, the type could be word, excel (1997 - 2007 format) or pdf. Then they would create an email in our application. The email would have a link to an aspx page which when visited, would parse the query string to find the readers
information in the database, update a record to indicate that they clicked the link to read the document, then do a response.redirect to the document.
View 4 Replies
Aug 16, 2010
I have a requirement to allow access to an app with users being authenticated by AD. Sadly, not all of the users who can access the app will have been authenticated this way so I need to provide a mechanism whereby if a user arrives as the site their authentication is checked using AD and if it fails, they are handed off to a login page that will attempt to authenticate them using the SqlMembershipProvider.
So, to my questions: how do I go about configuring it? If I want to use profiles, can both membership providers share one set of profile tables (stored in SQL)?
View 1 Replies
Nov 17, 2010
I am trying to trigger a postback if a certain condition is true. Initially, a user will click on a button on my form, the server does some work, and in the process of doing that work it assigns a hidden field the value of '1'. When the page reloads after that very first postback, I am trying to use javascript to check the hidden field, and if it is '1' I need the page to postback again so the server side can do some additional processing. The reason for doing it this roundabout way is so that I can create controls on the form from my C# code behind as well as download a file in 1 user interaction. Here is what I have so far:
<script type="text/javascript" language="JavaScript">
function atload() {
var HWInfo = document.getElementById('HiddenHW').value;
[code]...
View 3 Replies
Feb 23, 2011
i have a web form to insert into sql server 2008 db with stored procedure.
my stoed procedure is
USE [dbCustomers]
GO
SET [code]....
the code-behind; [Code]....
i'm being able to insert into my db if i fill all the fields. But if i want to leave blank the date or marital status fields, it gives the following error;
String was not recognized as a valid DateTime. String was not recognized as a valid Boolean.
View 5 Replies
Nov 15, 2010
I have a Windows 2008 Server IIS7 running ASP.NET 3.5 SP1 and ASP.NET 4.0 in Medium Trust. I am trying to execute System.IO.Directory.CreateDirectory method. It works fine with ASP.NET 4.0 but under ASP.NET 3.5 SP1 I get : SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib. What is going on ? Is this an ASP.NET 2.0 (3.5 SP1) bug ?
View 5 Replies
Dec 9, 2010
For some reason when I use the AsyncFileUpload it fails on the first attempt. All upload attemps that follow are always succssesful unless I close the browser and start again.
View 7 Replies