"Refresh" Connection Strings Used By Enterprise Library?

Jun 15, 2009

Our app allows admins to connect to a different database, which means we need to temporarily decrypt the app.config's connection strings, re-write them, then re-encrypt it. Here's my current 'simplified' code showing how we do all 3 tasks:

Dim config As Configuration = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None)
Dim section As ConfigurationSection = config.GetSection("connectionStrings")

[Code]....

View 2 Replies


ADVERTISEMENT

Encrypt Connections Strings While Also Making Them Editable (using Enterprise Library)?

Jul 28, 2009

we are using the Enterprise Library data access application block in our data layer for an application. We must be doing something wrong though because we cannot seem to get encryption and the ability to reconfigure connection strings working well. For example, when the application starts, it checks if the connection strings are "Protected", and if they are not, we encrypt them using the following function:

[Code]...

Then comes another issue. If a user installs an update for the application, the first time it runs, nothing can connect if the config file was previously encrypted. A restart of the application (second time running) will fix the issue. with all of the battles we are fighting here, I wanted to ask if we are doing this right? How should we be encrypting and allowing updates. If you need to see the exceptions thrown, I can provide those upon request (will need to change some code to get them again, but it is doable).

View 4 Replies

Are Using Microsoft Enterprise Library?

Jun 13, 2009

In my shop we currently develop what I would consider small to medium sized projects.We have been investigating the Enterprise Library and how it may be able to help us in development.I have particularly been looking at the Logging block and comparing it with Log4Net.It seems to me that the Enterprise Library blocks would be an extremely over-engineered solution for something like simple application logging.That being said. Are you using the Enterprise Library and on what size projects? What are your thoughts on the Enterprise Library as a whole?

View 10 Replies

Logging Out Of The Box Vs. Enterprise Library?

Jan 26, 2009

I just got finished watching a short video on logging using some of the built in concepts in Visual Studio 2005. This seems to do a good job. My question is why do people look for other solutions to logging such as Enterprise Library or Log4Net when there is a simple solution out of the box?

The video I watched primarily used the following for logging.

Code: My.Application.Log.WriteEntry(sb.ToString, type)

View 4 Replies

.net - Enterprise Library RangeValidator Syntax

Jan 8, 2010

I'm trying to use the Enterprise Library RangeValidator attribute to validate that a decimal value is greater than zero:

<RangeValidator(GetType(Decimal), "0.00", RangeBoundaryType.Exclusive, "1", RangeBoundaryType.Ignore, "MyMessage", "", Nothing, False, "", "")> _
Public Property Holding() As Decimal

[Code]....

As far as I can see I am using the overload correctly. It works fine if I remove the messageTemplate related parameters but I want to be able to specify a custom message.

View 1 Replies

Enterprise Library 5 Using MS Access Database?

Jul 7, 2010

how to use the Enterprise Library 5 connecting to a MS Access database using VB.NET 2010 on a windows forms application. Looking for quick code samples on how to add, select, update, delete records from an Access database.I'm trying to adopt Enterprise Library in my applications but I'm not finding much information on it.

View 2 Replies

Exception Using Microsoft Enterprise Library Data

Apr 15, 2009

i'm trying to debug an application i'm currently developing but somehow i'm now getting the following exception The type initializer for 'SupervisorProducao.MdlConstantes' threw an exception. the exception occurs when i reach this

[Code]...

View 1 Replies

Update 6.0 Enterprise Edition With MSDN Library

May 30, 2010

I want to know how can i update my visual basic 6.0 MSDN library.

View 1 Replies

VS 2010 NullReference Exception With Enterprise Library 3.10?

Mar 7, 2011

I'm getting a design time NullReferenceException on Dim db As Database = DatabaseFactory.CreateDatabase()and I can't figure out what to do about it. Has anyone experienced this problem or know the solution?

View 6 Replies

C# - Enterprise Library Strong Naming Guidance Package

Mar 18, 2009

For the life of me I can not find the Enterprise Library Strong Naming Guidance Package download for Enterprise Library 4.1

I need this to sign the assemblies to add them to the GAC.

Does anybody know where I can find it?

View 2 Replies

Set Command Time Out For Enterprise Library 4.1 Data Access?

Sep 14, 2010

I am trying to set command timeout for enterprise library 4.1 data access. I used below code for get command object from Database.[code]....

View 2 Replies

Refresh A SQL Database Connection?

Mar 15, 2009

How do you refresh a database connection within a VB application to SQL Server 2005 so that whenever data is changed in SQL, such changes are picked up by the application? For now the application only picks up the changes after it has been restarted, and that is not what I want.

View 5 Replies

Connection Strings To SQLExpress R2?

Aug 20, 2010

I have several programs I have written for my music studio/production company. Many dealing with inventory, customer DB etc. All of my programs are in VB6 and I have started to convert them all to VB.NET. I am getting proficient with VB.NET and connecting to DB using the very simple and generic connection strings, Example:

dbProvider = "PROVIDER=Microsoft.Jet.OLEDB.4.0;"
dbSource = "Data Source = C:/develop/Customer Tracking/resource.mdb"
con.ConnectionString = dbProvider & dbSource

[Code]....

As you can see I am using a basic MSAccess DB and I want to get away from this and start using SQLExpress,

connect to a standard SQLExpress DB? (when I loaded SQLExpress I took the defaults...)

View 1 Replies

MS Office Connection Strings?

Oct 28, 2011

What is a dynamic MS Office Connection string? I have realized that each each version of MS Access has a unique Connection String. Now my concern is that if I use MS Access 2007, for example, it may haave compatibility/connection problems if an application is deployed in a machine with a different edition of MS Access. Is my understanding correct? If so, how to go around this hiccup?

View 2 Replies

Sql Server - SQL Connection Strings

Mar 19, 2012

I'm creating a program in VB.Net that heavily interacts with 2 large MSSQL databases. I do not know a ton of vb and I'm fairly new, but I would assume just having the connection strings in the code and releasing the program it would be quite easy for someone to reverse the program and get my connection info? correct me if I'm wrong. My question is I'm wondering if there is a safer way to use a connection string in my program. Would I just have to encrypt my app? Create a module or dll?

View 2 Replies

Change Connection String In Class Library Project?

Jun 30, 2011

In my earlier project I was able to change the connection string during the app settings loaded event and it was successfully. When I try to do the same for a code library project, I am not getting the system.configuration.connectionstringsettings to work. Could you please tell if there is a work around for this, or else it is always better to write the sql code instead of depending on the adapters etc.

Additional information: Clients App is WPF with Vb. Database is SQL Server 2008 Code Lib would only be on server, slq connectiona and data retrieving and saving actions are stored in classes in code lib only. Code Lib would be used with WCF, wcf is used to share the classes only and classes have the data. WCF is hosted as a windows service on server used by NET.TCP

View 2 Replies

ADO - Best Practices When Using Tableadapters, Sql Connection Strings

May 2, 2010

I have read and worked through all of the examples in the book "ADO.NET 2.O", but there is so much there with so many ways to handle data, I am having difficulty translating the examples into my own real life application. I am confused about creating runtime connection strings, connection strings in my app.config file, connection strings in the properties for a sql connection control, etc.

I have a midichildform with a datagridview control, and I use a table adapter to edit and update the SQL Server 2005 Express edition database. There is no problem there. However, I also have a button control that I want to use to "process" the data that has been updated with the table adapter. I want to open the updated table, read each record on at a time, manipulate the data and add a records to another table. Do I have to create a connection string and an oleDBconnection? Or can I somehow use the connection string that is in my app.config file? [Code]

View 9 Replies

Build Secure Connection Strings?

Oct 3, 2010

I need a bit of advice. I would like to store secure connection strings somewhere safe in vb.net. How can I build the secure connection strings in what situation and what would be the best?

As I have done the little research and found that the secure connection strings would be encrypted the strings and input the strings in app.config, so I would have to make a change in the app.config[code]...

View 2 Replies

DB/Reporting :: Access Connection Strings?

Sep 12, 2011

I have been struggling with the construction of an Access connection string. Here's the problem.My Visual Basic 2008 project is located in a disk partition on my hard drive that I have named S:. My Access MDB file is in the same location.When I deploy the application it obviously will not be in an S: drive on the user's machine. My concern is that if I construct the Connection String using the file designations on my computer as:

(Provider =Microsoft.Jet.OLEDB.4.0; Data Source =S:MyApplicationmydatabase.mdb; User Id =admin; Password =

The deployed application won't know where to look for the data file. I know there are some shortcuts that will allow me to construct the connection string, but I do not know either the designated names or where to find them.

View 1 Replies

Passing Connection Strings Between Assemblies?

Sep 2, 2010

I have two executables that access a DLL containing Data Access Layer objects Each exe can have a different config containing info on server and database name, connection string etc.How do I pass the config info to the DAL objects?

Obviously I can pass the config strings to the DAL objects every time I instanciate one, but that seems messy and repetitive as every class in the DAL will require Properties for the Config strings..if there is a way for the instanciated DAL objects to read some properties from the calling object without me having to pass them explicitly?

View 2 Replies

Sql - Storing Connection Strings In Registry?

Nov 24, 2009

We decided to use the registry for handling our deployment with connection strings in our VB.net application.

The requirements are:

If the program cannot connect to the server, first check the registry for a connection string. IF not, create the folder and fill in the name, type, and data. Make sure its encrypted.

I have never edited or created anything in the registry.

View 2 Replies

Sql Server - Use Database Connection Strings In ASP.NET?

May 26, 2011

I've just started ASP.NET for real, and I was wondering if it is possible to use connection strings from Data Sources instead of hard-coding them. I've added my connection in Data Sources and it works, and I can also drag a table to a page in design mode, but I can't figure out how to access it in code. Here's what I get when I drag it in:

<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
DataSourceID="SqlDataSource1"
EmptyDataText="There are no data records to display.">[code].....

View 3 Replies

Store Connection Strings Per User?

May 21, 2010

In the past I've used a Singleton Pattern to load the connection string when the application starts via the global.asa file.

I have a project now where each user has a unique connection string to the database. I would like to load this connection string once. The issue is that the singleton pattern will not work for me since each user has there own connection string. Basically the connection string is created dynamically.

I do not want to store it is session. If anyway has a clever way of doing this in .NET let me know ?

View 1 Replies

Change Connection String From Class Library In Main Application At Runtime?

Jan 16, 2009

You can change the connection string at run-time like this. You make the connection string setting available for writing as a separate property inside the MySettings class:

Partial Friend NotInheritable Class MySettings
Public WriteOnly Property RunTimeConnectionString()
Set(ByVal value)

[code]....

Then, in some place when the application is being initialized (before using any table adapters of typed datasets), write something like:

My.Settings.RunTimeConnectionString = My.Settings.ProductionConnectionString

Where ProductionConnectionString is a simple String setting. It is a User Scope setting so every user can change it (by assigning a value to it, similar to the code above) and save it by calling My.Settings.Save()This code works well for connection strings which were initially created in the main project and stored in it's settings (= app.config file).

The connection string in the app.config actually has a longer name: MyApp.MySettings.MyConnectionString.When you have a connection string stored in the app.config in a class library project, and reference that project in the main project, the app.config files will somehow be merged, so the class library has it's settings.The thing that don't know how to do, is change a setting from the class library at run-time. I could copy the connection string setting from the class library to the main project's app.config. I must keep the same name, which looks something like: MyClassLibrary.My.MySettings.MyConnectionString.Can the same principle I showed above be somehow applied to this second connection string?

View 3 Replies

.net - Retrieving Mysql Connection Strings From App.config?

Oct 24, 2011

How can I call the connection string by name from an app.config file in my vb.net program?

View 1 Replies

Accessing The Connection Strings From The APP.CONFIG File?

Dec 4, 2009

I'm having trouble accessing the connection string from the app.config file. my connection string is:
Dim sConnect As String = "Data Source=.SQLEXPRESS;AttachDbFilename=G:VB Level 1ProjectContactsDB.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True"

I using this string in a few different places, but I want to access it from the App.Config file. I've been at it for awhile and can't get it working.

View 3 Replies

Demonstrate How DbConnectionStringBuilder Works With Connection Strings?

Jul 1, 2010

from [url] they write this:

This example includes a password to demonstrate how DbConnectionStringBuilder works with connection strings. In your applications, we recommend that you use Windows Authentication. If you must use a password, do not include a hard-coded password in your application.but if we do not hard-code the password then does it mean that we are supposed to retrieve the password from some other place? so is it correct to say that we should save the password in a file and then retrieve it when the app runs?

View 10 Replies

IDE :: Missing Connection Strings In Application Settings

Nov 11, 2010

I am using VB 2008 & MS Access 2007 Databases for my Windows Forms Applications.The Problem is my Connection strings have been disappeared from DataSource Configuration Wizards & now i am unable to edit any Connection String in DataSet Designer.I had tried to create a Macro in MS Access Data File but didn't know how to create & so desided not to save any & just quit from Access and came back to Visual studio. Since then only this prob. has started. Earlier to this everything was just fine.I have tried to uninstall MS Office as well as Visual Studio then Re-installed Visual Studio but the problem is still there.

1] Error while trying to Reconfigure Data Adapter in Dataset

2] Disappeared options & Empty Connection Combo Box

3] Add Connection DialogBox with no DataSource property line in the Grid control

View 2 Replies

Read 2 Connection Strings From External File?

Sep 9, 2011

I have a situation where I have a vb.net program that uses two connection strings. This program will be used on multiple web servers on multiple domains and the only difference for any of them is the two connection strings.What would be the best solution to read in these connection strings from a file separate from my actual .vb code?

Ideally I want to be able to drop the .vb and the connection string file into its own folder on any number of asp.net websites and not update anything else (for example add any connections to the web.config or anything) than the external file containing the connection strings, I assume something like xml would suffice?

View 2 Replies

VS 2005 Build Secure Connection Strings

Oct 3, 2010

I would like to store secure connection strings somewhere safe in vb.net. How can I build the secure connection strings in what situation and what would be the best??

As I have done the little research and found that the secure connection strings would be encrypted the strings and input the strings in app.config, so I would have to make a change in the app.config

To change from this unprotected app.config:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>

[Code]....

The code have been built to a guy who known as Nick J. Fessel. I am not too sure if it very secure to use it so. Do anyone know that if the connection strings is secure or not?

info for the secure connection strings without being found out

View 6 Replies







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