C# - Can Use Config File For Key Value Pairs

Nov 1, 2010

I have several key value pairs or mapping value, like Eg: Liquid Manufacturing -> Processing+Batching+Filling+Sealing

There are several such key value pairs. These values might change frequently. Whats the best practice? Can I save them to XML based config files? or database? Can I have them in a config file and read it into a dictionary and use it in my application?

"When will they change? Can the user change them or is it changed when the application is installed? Is the setting per user or per application? Is the setting valid only for one machine or does the same setting apply to clients on several machines?"

User cannot change them. Setting applies to entire application, all machines.

View 4 Replies


Similar Messages:

Configuration :: How To Merge A Distribution Web.config File And An Existing Web.config File

Mar 30, 2010

I'm preparing to deploy a ASP.NET web application. The target server has already a previous version of my web application with parameters specified on the web.config file.

In the new version of this web application, the web.config file contains new sections I would like they appear into the target web.config file on the server.

However I can't find the way to merge the new web.config sections into the existing web.config file ?

Does I have to do it programmatically, or is there a tool to merge the both files during installation ? (I'm using Web Setup Project).

View 2 Replies

Web Forms :: Access One Web.config File To Another Web.config File?

Jul 26, 2010

I have one doubt Can we access one web.config file to another web.config file in asp.net

View 6 Replies

How To Create A Common Web.config File And A Bunch Of Specific Web.config Files

Feb 16, 2011

Currently, I work on an ASP.NET project which is hosted under version control and is used on several developer machines, tester machine and production environment.

In three cases, configuration (Web.config) may be different. For example, developer and tester environments use testing SQL Server, whereas in production environment, another SQL Server is accessed, so the connection string is different in those cases.

We want to keep three versions of Web.config in subversion. But modifying each of three files every time we need to add, remove or change a common setting is annoying: it would be nice to have a common, master Web.config, which will be inherited by each of the three Web.config files.

How to set up an ASP.NET project which will use a master configuration file and different slave configuration files on different machines, thus sharing the same project/source code/configuration files in subversion?

View 2 Replies

How To Determine Which Parent Config File Is Locking A Web.config Setting

Mar 15, 2011

When I open my ASP.NET site in IIS and try to open the .NET Trust Levels, I get an error message:

.NET Trust Levels There was an error while performing this operation.

Details:
Filename: ?C:inetpubwwwrootmyappweb.config
Line number: 445

Error: This configuration section cannot be used at this path. This happens when the section is locked at a parent level. Locking is either by default (overrideModeDefault="Deny"),or set explicitly by a location tag with overrideMode="Deny" or the legacy allowOverride="false".

I've checked a few places, but I haven't found anything that seems like it would be locking that setting. Is there a systematic way of determining where that setting is locked?

I'm using IIS 7.5 and .NET 3.5 sp1.

View 1 Replies

Read Settings / Sections From The Web.config Or App.config File?

Jul 8, 2010

I have many Connection strings in my web.config file. I also have a "dataConfiguration" setting in the same file which specifies what database my app connects to.

How do I read the "defaultDatabase" setting / section from the, see below xml file.
<configuration>

<configSections> [code]....

View 2 Replies

Configuration :: How To Read Web.config File In App.Config In Web Application

Jan 5, 2011

I am developing web applicaiton. I want to read web.config in App.config file. I have appSettings and connectionStrings in web.config. How to read that?

View 10 Replies

DataSource Controls :: How Get Sum Of Different Pairs

Mar 13, 2010

The table design is like this:

ColumnA -- varchar(50)
ColumnB -- varchar (50)
ColumnC -- int
The table data is like this:
ColumnA ColumnB ColumnC
Abc def 10
Abc pqr 10
Abc def 20
Def pqr 50

The required output is:

Abc def 30
Abc pqr 10
Def pqr 10

That is if the records of the different rows of ColumnA & ColumnB are same then sumation of ColumnC should be done. Otherwise data is displayed as it is.

View 3 Replies

Radio Button Pairs Of Same GroupName?

Aug 18, 2010

I have some radio button pairs of same groupName. If I set one radio button to checked = True , as a result, the view is not displayed. I'm writing the code in aspx.cs but view is not updated. For other controls its get updated.

chatSettingsNode = xDoc.SelectSingleNode("//ToolBarChatSettings/ChatSettings/AdminSettings/Emoticons");
valueChk = chatSettingsNode.InnerXml;
value = Convert.ToBoolean(valueChk);
if (value == true)
{
rbtnAdminEmoticonsYes.Checked = true;

[Code]....

View 2 Replies

.NET Matching Id On Label And Input Pairs?

Feb 10, 2011

Is have about 20 label/input pairs on a page that use JS to give them unique styling. For this to work they must have matching id's on each pair.

This is the way the I would like the HTML to be formatted:

<p class="radioBtn">
<label for="business00"></label>
<input id="business00" type="radio" name="radioBtn" value="" />[code]....

and so on.Can this be achieved using ASP.NET?

View 1 Replies

Architecture :: Key, Value Pairs Implementation In Class?

Feb 16, 2010

In a project im working on there are many sql tables containing different ID, Name pairs. Those are represented as Enums in classes that need them however that requires casting since tables contain ID only.Also when serialize the Enum contains the ID not value.

View 3 Replies

Separate Config File For Sections Of Web.config?

Dec 17, 2010

Is it possible to have separate config files for specific sections of the web.config? Specifically I'd like to move IIS 7's rewrite section out of the web.config and into it's own config file.

View 3 Replies

Passing List Of Name / Value Pairs To Stored Procedure?

Aug 10, 2010

I have a name/value pair in a List<T> and needing to find the best way to pass these to a stored procedure.

Id Name
1 abc
2 bbc
3 cnn

What is the best way to accomplish this?

View 3 Replies

Machine.config File Know About Web.config?

Feb 16, 2010

It is known that we use web.config file to override the setting of machine.config file.

a) how come machine.config file knows that only changes made in web.config file are to be overwritten. I mean to say, if I use some other name for the config file say xyz.config, will it be able to work?

b) How does machine.config file know about web.config? Is there any link mentioned inside the machine.config file for that?

View 1 Replies

Configuration :: Error 1 Could Not Open Source File: Could Not Find File 'C:11-22 EstobjDebugCSAutoParameterize RansformedWeb.config'. 0 0 Test

Nov 24, 2010

I have built an ASP.NET (.NET v4) application in VS 2010. It is working just fine. But when I try to create deployment package (so I can deploy it in our test IIS 7.5 Server), it gives me error like this,

Error 1 Could not open Source file: Could not find file 'C:11-2 estobjDebugCSAutoParameterize ransformedWeb.config'. 0 0 test

Thing is in past, I had deployed the SAME application using the SAME method.

View 2 Replies

SQL Reporting :: How To Export Pdf File With Specified Marginn In Config File

Sep 8, 2010

In my project i wants to display report and export it in pdf format so that i used rdlc but now my requirement is that there are some labels like name,address for it i wants to give some specific margin from left right(x,y) and i wants to give this margin by config file. "how can we set margin in rdlc from cofig file or run time?"

View 1 Replies

C# - Encrypting A Web.config File And Supplying The Path To The File

Feb 7, 2011

I am encrypying my .NET config file using this command and it works just fine:

aspnet_regiis -pe "connectionStrings" -app "/SampleApplication"

For this to work though I have to have a virtual directory called SampleApplication pointing to the folder my web.config file is under.

Is there a way to just specify the path to the file and not have to have a virtual dir?

I tried with

aspnet_regiis -pe "connectionStrings" -location "c:FoldercontainingWebConfigFile"

but i get the error: " path attribute must be a relative virtual path". And cannot contain any of ":" "" etc...

I am looking here:

[URL]

View 3 Replies

C# - How To Modify A Web.config File As If It Was A Text File

Feb 28, 2011

by looking at using the XmlDocument and creating elements and attributes and then inserting them into the document. Pretty soon this looked like a massive amount of work for all the elements I have to add.What are the repercussions of treating the config file as one big long text string and doing a replace at certain points to add my entries. Something like this...

private void InsertXMLElement()
{
StringBuilder webConfig = new StringBuilder();
// get the file into a stringbuilder for manipulation
using (var sr = new StreamReader("C:web.config"))
{
webConfig.Append(sr.ReadToEnd());

View 3 Replies

Javascript - Getting Iframe Page Name / Value Pairs In Parent Page Submit

Nov 17, 2010

I have a Parent Page that includes an iframe containing html page with many field. The parent page contains the "Save" button. Now i want to get the values of iframe page while submitting the parent page. How can i access the iframe pages fields in parent page submit?

View 2 Replies

Configuration :: What Is The Diff Between Link To Assemblies In Project File And Assemblies In Web.config File

Apr 30, 2010

when I reference a assembly. It's reference gets added to the project file in my case ( ABC.csproj)

Also when I take a look at the web.config file there is a section called <assemblies>. And lot of assemblies are added there.

What is the difference between link to the assemblies in the Project file and the assemblies in the web.config file?

View 1 Replies

Save Value In Web.config File From C#?

Nov 26, 2010

I need to update these fields from the front end, using c#.

<configuration>
<appSettings>
<add key="email.fromAddress" value="printingshop@rp.sg"/>
<add key="email.fromName" value="help-printingshop"/>
<add key="email.toAddress" value=""/>
<add key="email.ccAddress" value="printingshop@rp.sg,
OSC_Projects@rp.sg"/>
</appSettings>
<connectionStrings>

View 2 Replies

Trying To Write A New Web.config File Using VB?

Jun 16, 2010

I'm trying to write a new web.config file using VB in ASP.net. I am trying to set access permissions, but it won't let me use the question mark to denote: <deny users="?" /> in the authorization tag. Is there an alternative to this or a different encoding I should be using for this character?

My specific error: The '?' character cannot be used here.

'Create file, overwrite if exists
'enc is encoding object required by constructor
'It is null, so default encoding is used
Dim objXMLTW As New XmlTextWriter((MapPath(".") & "asic" & fold & "" & "web.config"), Nothing)
objXMLTW.WriteStartDocument()
'Top level (Parent element)
objXMLTW.WriteStartElement("configuration")
'Child elements, from request form
objXMLTW.WriteStartElement("system.web")
objXMLTW.WriteStartElement("auhorization")
objXMLTW.WriteString("deny users="?"")
objXMLTW.WriteEndElement()
objXMLTW.WriteEndElement()
objXMLTW.WriteEndElement() 'End top level element
objXMLTW.WriteEndDocument() 'End Document
objXMLTW.Flush() 'Write to file
objXMLTW.Close()

View 3 Replies

Web Config File To Run World On IIS 7?

Jan 13, 2010

I have uploaded a simple hello world on my IIS server 7 (shared hosting). It doesn't work. Is it necessary to add a web config and what's the minimum in that case ?

Error says:

Server Application Unavailable

The web application you are attempting to access on this web server is currently unavailable. Please hit the "Refresh" button in your web browser to retry your request.

Here's the script, very basic :)

<%@ Page Language="VB" %>
<html>
<head>
<title>ASP.NET Hello World</title>
</head>
<body bgcolor="#FFFFFF">
<p><%= "Hello World!" %></p>
</body>
</html>

View 2 Replies

How To Encrypt A Web.config File

Mar 16, 2011

How can I encrypt a web.config file? And how can I then decrypt it again?

View 2 Replies

Using Encrypted Web.config File?

Jun 18, 2010

My aim is to make the web.config not readable by external users, but my application should be able to access it. Is there any way to do this?

I have tried the following way, but how to set the application to use string instead of web.config?

I want to encrypt my web.config file so that others do not open the file using any editor like notepad. But my application should be able to use the same web.config file. I could encrypt the web.config file and decrypt it inside the application and I saved the entire web.config to a string file. Now I want to use this string variable instead of web.config(now in encrypted form, which cannot be accessed by the application).

View 3 Replies







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