Configuration :: Webservice WebConfig File Not Recognized By Windows App?

Mar 2, 2011

I have created a webservice, which debugs fine with no errors, and published this on my localhost server for testing.

I have created a windows app which calls the webservice but am hitting problems as soon as I reach the point where the webservice tries to connect to its database.

The connectionstring is held within the web.config file of the webservice as

>><connectionStrings>
<add name="MyConnectionName" providerName="System.Data.ProviderName" connectionString="server=MyServerName; database=MyDataBaseName;uid=MyUser;pwd=MyPassword;"/>
</connectionStrings>

and called within the code by using the statement

>> System.Configuration.ConfigurationManager.ConnectionStrings["MyConnectionName"].ConnectionString

, and as I said before, this works perfectly when debugging the webservice application directly.

However, the windows application is not seeing the connection properly, if I use the statement as above I get a debug error stating that it is a NULL reference. If I change it to

>> System.Configuration.ConfigurationManager.ConnectionStrings[0].ConnectionString

I no longer get a debug error, but the connection is not made. On testing the above code it believes the name for connection 0 is "localSqlServer" and in both the web app and the webservice the error below is returned.

>>An attempt to attach an auto-named database for file \MyServerMyDirectoryMyProjectMyProjectApp_Dataaspnetdb.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.

why the windows application see's the correct connection string code as null? Is there additional security I need to add for the web.config file to be accessible? Or does the connection strings need to be relicated within the app.config of the windows app?

Both applications are written in C# and I use Visual Studio 2010, ASP.Net version 4.0.30319

View 4 Replies


Similar Messages:

Configuration ::access The Second External Config File From Same Webconfig

May 11, 2010

how can i access 2 external config files from web.config file.

i have done it for one external file like this in webconfig:

<appSettings file="........">

Now how can i access the second external config file from same webconfig.

View 1 Replies

Configuration :: How To Set Trust Level "FULL" In Webconfig File

Aug 19, 2010

How to set Trust level "FULL" in webconfig file.

View 1 Replies

Configuration :: Best Configuration Of Iis7 And Webconfig For Application

Feb 19, 2011

i have my own cloude server. with iis7(OS:window server 2008) . i want to deploy my webApplication on that can u tell me best configuration of iis7 and webconfig file for my application.

View 3 Replies

Configuration :: Integrating Webconfig From Working App Into Another App?

Aug 22, 2010

I have a website application which performs a function which I need to integrate into my main website application. Right now I'm getting errors as I copy and paste the parts of the web.config file from the working app into my main app. When I just paste in the assemblies, I get 2 errors. I'm just going to just paste both of them here and if you think you integrate them, I'd really appreciate it if you would paste it here in the thread.

[Code]....

And here is the one I'm trying to integrate into the one above:

[Code]....

View 1 Replies

Configuration :: How To Encrypt Email Setting In Webconfig

Jan 25, 2011

How to encrypt email setting in webconfig ?

<mailSettings>
<smtp from="abc@ddd.com">
<network host="174.xxx.xxx" password="xxxxx" userName="abc@ddd.com" port="25"/>
</smtp>
</mailSettings>

View 5 Replies

Configuration :: Make Credentials Secure In WebConfig?

Mar 22, 2011

[Code]....

i have a above connections string in which i use UserName: taha1_ID2, Password: taha321, and SQL Server DataBase Name:taha1_web2 How can we encrypt it in web.Config

Note: All the above are fake.

View 4 Replies

Configuration :: Assemblies Of Webconfig Not Working Online?

Jun 29, 2010

I have added few assemblies of microsoft through:-

right click on project name->add reference->com tab

Its get added and are shown in web config like:-

<compilation debug="true">
<assemblies>
<add assembly="Microsoft.....">
</assemblies>
</compilation>

Whatever I want to do using all this, its Working fine locally..

BUT when I upload it, this web config file shows error and doesnt proceed at all and my website goes down.

View 6 Replies

Configuration :: Read Webconfig From The Hosted Server?

Dec 27, 2010

I am facing strange problem. I have a database connection string in web.config. I am not able to read web.config file. Its perfectly working in our server and my system also. After hosted in outside server, i am not able to read web.config file at all. What could be the problem.

View 18 Replies

Configuration :: Set File For Windows Service Application?

Nov 6, 2010

I have a visual studion 2010 solution with two projects

1 . A class libarary

[Code]....

2. A windows service application

[Code]....

The service application is used to convert .dbf files to xml. The convertion is done using the classlibary project wich is called by the windows service application. This class library project has some values hard coded. like the path to look for the .dbf file

const string sourcePath = @"F:forms";
const string pathToDbfStructure = @"F:formsstructure.dbf";
const string pathToBackupFile = @"F:ackup";

I want to make these hard coded values changable. like moving them to an app.config file. To which project I have to add the app.config file (classlibary or windows service)? How can I use the value from configuration file in classlibrary ?

View 3 Replies

Configuration :: Exclude A Page From Webconfig CustomErrors DefaultRedirect ?

Sep 30, 2010

My Web.config customErrors section is given below

<customErrors
mode="RemoteOnly"
defaultRedirect="error.htm"></customErrors>

How can I exclude a aspx page from DefaultRedirect, if errors occur in that page?

View 3 Replies

Configuration :: Access To Report File Denied - Another Program May Be Using It - In Windows 7

Feb 16, 2011

[[COMException (0x80000220): Error in File C:WindowsTEMPSmall {287137BF-8E50-469F-B436-A0A385C7912A}.rpt:

Access to report file denied. Another program may be using it.i am getting this error while accessing the report in windows 7 we need to give write permission in IIS but how do i assign the write permission and to which file or folder or user do i need to assign it

View 2 Replies

Configuration :: File Permissions For .aspx Files On Windows Server 2008?

Jul 7, 2010

I am running a web-site with simple .aspx files on a standalone workgroup Windows Server 2008 called 'Max'.I had assumed that the .aspx files were accessed by the 'Network Service' account.The application pool for the website is running with 'Network Service' as the process account.I was puzzled, since 'Network Service' had no permission on these files. So I added event level auditing to the files, and I was suprised to learn that the .aspx files were being accessed by an account called Max$ (ie the computer account).this correct ?Why is the Network Service account not being used ??

View 3 Replies

Calling Connection String From Webconfig File?

Jun 9, 2010

I'm using Visual Studio 2008 and SQL Server 2008 Developer to create a website.

I'm trying to test a connectino to a local database in my computer.

What I did is create a connection string in the webconfig file like this:

[Code]....

Then I want to call that connection string like this in the default.aspx.cs file I write the following code:

[Code]....

I'm not getting any error or warning in any of the code but when I run the page I throws me an error telling me:

The connectionstring property has not been initialized.

If I run with debug on it shows this:

[Code]....

Line 22 in red.

I don't know what I'm doing wrong since VIsual Studio does not tell me there is an error, it just seems like it cannot make the connection.

View 4 Replies

Implementing And Accessing Values From A Webconfig File?

Jan 14, 2010

I would like to use the webconfig file to store some values, which will be used in my application in order to execute some methods, one a parameter for a timer, the Interval property and the other to pass as parameters in a method.

So, my questions are:

Where in the webconfig can save these parameters in order to make them accessible to the applicationHow do I access these parameters in my application in order to use in the aspx page for the timer control and in the code behind for a method to use

View 2 Replies

Web Forms :: Data Connectivity From Webconfig File?

Apr 28, 2010

I have a dropdownlist which is connected to object data source for displaying data, now what I need is to connect to database using semicolon seperated list from web.config connection strings and then connect that to dropdownlist.

View 5 Replies

Code To Set Legacy Mode In Webconfig File Through C#?

Apr 29, 2010

how to set the <xhtmlConformance mode="legacy"/> tag in web.config as "strict" using the codes in c#.net for an asp.net webaplication

View 1 Replies

C# - A Config File In Java Similar To The Webconfig ?

Mar 24, 2011

I'm new to java and android, originally from an asp.net/c# background.I am looking for a config file in java, similar to the webconfig of app config with .net but there doesn't seem to be one.

View 3 Replies

Configuration :: Temporary File Size Of Windows Reaches Around 10MB, Than The Application Blocks And The Reports Cannot Be Generated?

Jan 14, 2011

I have an application that is hosted in Server 2008 Standard Edition.It has more than 50 active users that uses it. The problem is that when Temporary file size of Windows (C:Windows emp) reaches around 10MB, than the application blocks and the reports cannot be generated.When we clear this temp folder and reset Refresh IIS, the application starts working again.Below is the code we use to generate reports:

[Code]....

View 7 Replies

Security :: Webconfig File / Doesn't Get Sent To SuperUser.aspx

Feb 20, 2010

I have the following webconfig file that redirects (once logged in) a specific user...but for some reason it's not seeing the redirect location. So, for some reason when john123 log's in he doesn't get sent to superUser.aspx. It's as if it's not seeing the location path.

View 3 Replies

.net - Changes To Xml File Not Being Recognized?

Apr 8, 2010

I read a xml file (myConfig.config) and provide it as an input to a CLR method. When I make changes to this xml file, it doesn't seem to be recognizing it. When this line throws an error, I always see the first version of the file as a part of the error message.In the config file properties, I have set Copy to Output Directory as Copy always, but it still doesn't seem to work.

View 2 Replies

VS 2008 - Call Connection String From Webconfig File From Web Form?

Nov 18, 2010

How do I call the connection string in the webconfig file from a web form?

View 4 Replies

Commas Not Recognized In File Exists?

Jul 21, 2012

I have a .net aspx project done with VS 2008 using the .Net 2.xxxx framework. This ASPX application is deployed on and 4 different 2003 Server boxes. 3 are running in total beautifully. In the 4th box is my issue. I do a FILE.EXISTS conditional test looking for case file pdf's. These case numbers are structured as such 2012-C-0421,001,0008.PDF

Please note the comma's used in the path. 3 of the 4 servers in court houses recognize the path to the pdf WITH the commas in them perfectly and the FILE.EXISTS works 100%. On the fourth box (same config we THINK) the exact same FILE.EXISTS does not return a hit even though we see the document sitting in the folder via explorer. IF we remove the commas and make it 2012-C-0421001008.pdf all is fine and document is indeed discovered with the EXISTS.

WHY on this one server does the original ducument path not function. We can not ask the court houses to change the way they store their documents so I need to make this work like the other 3. Again... same version..same .net framework... same OS (2003 server)

View 4 Replies

Configuration :: Web.config Not Agreeing With Windows Server 2008 SP2 Or Windows 7

Mar 8, 2010

I've installed IIS for Windows Server 2008 SP2 and Windows 7. In both instances, I can't get even the simplest of ASP.net scripts to work (note: I'm ftping the published files from Visual Web Dev 2008 Express on XP):

------------------------------------LOCAL MESSAGE---------------------------------------------

Configuration Error

Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.

Source Error

[Code]....

Line 36: ASP.NET to identify an incoming user.Line 37: -->Line 38:
<authentication mode="Windows"/>Line 39: <!--Line 40: The <customErrors> section enables configuration
Source File: C:inetpubwwwroot estweb.config Line: 38


------------------------------------REMOTE MESSAGE-------------------------------------------

Runtime Error

Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.

Details: To enable the details of this specific error message to be viewable on remote machines, please create a

<customErrors> tag within a "web.config" configuration file
located in the root directory of the current web application. This
<customErrors> tag should then have its "mode" attribute set to
"Off".

[Code]....

<!-- Web.Config Configuration File --><configuration> <system.web> <customErrors mode="Off"/> </system.web></configuration>

Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.

[Code]....

<!-- Web.Config Configuration File --><configuration> <system.web> <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/> </system.web></configuration>

Can anyone tell me what I'm doing wrong here in the web.config file? This is killing me.

View 5 Replies

Web Forms :: Web Controls In Code Behind File Not Recognized?

Aug 3, 2010

I downloaded iTracker to get started doing some web development with ASP.NET. I don't understand why in the code behind file, the standard web controls are not recognized.

For example:

This is the ASPX File ...............

<%@ Page Language="vb" AutoEventWireup="false" MasterPageFile="~/ITracker.Master" CodeBehind="Details.aspx.vb" Inherits="dfs.ITracker.Details"
title="Untitled Page" %>
<asp:Content ID="Content2" ContentPlaceHolderID="cphTitle" runat="server">
<asp:label ID="lblPageHeader" runat="server" CssClass="PageHeader"></asp:label>...

View 6 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved