VS 2010 N-tier Approach - Saving SQL Connection

Sep 29, 2010

What is the most correct way to save your connection string when using the n-tier approach ? Right now I have two windows app and one web app using my DLL library, what I'm currently doing is to create a static
method inside my dal "GLOBALDAL"
inside I'm making this check:

Code:
if (System.Web.HttpContext.Current != null) ...
if httpContext.Current is null
That's mean that one of my windows applications doing the request, if so I get the CN from a file otherwise it's mean its the website knocking on my door so I get the CN from:
Code: System.Web.HttpContext.Current.Application["ConnectionString"]
I am thinking of changing it all and just set properly in my DA layer that expose the CN as a string. But I fear of security issues. So what is the correct way?

View 21 Replies


Similar Messages:

C# - N - Tier Architecture Approach - Web Application Clearing Confusion

Aug 14, 2010

Well i want to know how many architecture approaches we can use in asp.net web application. i was asked about it. i told him that i use a appcode for dal and bal and the presentation layer. but he was not convince. basically i want to ask what web application architecture an asp.net web application guru would use keeping in mind the different metrics ( i am talking minus web services or any SOA thing)

View 1 Replies

Common Approach While Saving And Editing Images In A Website?

Sep 8, 2010

I am building a website using asp.net and this website will host users images and will give them options to edit these images by resizing, cropping, watermarking,.... am thinking of 2 ways to save images and want someone to recommend one or advice me with something different better.1- The user will upload his images, i will put them in a folder called "original" then the user will edit these image, i will put the edited images in a folder called "edited" also will have another folder called "thumb" will contain thumbnails from these images for previewing on the website.

View 1 Replies

Web Config - Where Should Connection Strings Be Stored In A N-tier Application

Sep 29, 2010

I have an ASP.NET project which is pretty n-tier, by namespace, but I need to separate into three projects: Data Layer, Middle Tier and Front End.

I am doing this because...

A) It seems the right thing to do, and

B) I am having all sorts of problems running unit tests for ASP.NET hosted assemblies.

Anyway, my question is, where do you keep your config info?

Right now, for example, my middle tier classes (which uses Linq to SQL) automatically pull their connection string information from the web.config when instantiating a new data context.

If my data layer is in another project can/should it be using the web.config for configuration info?

If so, how will a unit test, (typically in a separate assembly) provide soch configuration info?

View 3 Replies

ADO.NET :: Find Connection String Path In Three Tier Architecture?

Jul 27, 2010

How to find connection string path in three tier architecture?

View 3 Replies

How To Approach A Sharepoint 2010 Development Project Coming From WebForms And MVC

Jan 20, 2011

I have a good amount of knowledge in the ASP.NET Webforms and MVC worlds. Shortly I will be tasked with implementing custom web applications with Sharepoint. I have great flexibility with this project (i.e - I can use custom web apps outside of Sharepoint if that's possible) but like most projects the most limiting factor I have to deal with is time.

Here are some questions that come to mind:

Can I easily integrate a custom MVC project into Sharepoint 2010? What are the pros and cons if I can? Same as #1 only with Webforms. If #1 and #2 are not viable solutions, can I easily create custom web applications within the Sharepoint world? What will the learning curve be with my background? I understand developers can now use Windows 7 to deliver Sharepoint 2010 solutions. It looks like I can use a trial of Microsoft Sharepoint Foundations 2010. If that's correct, are there any development differences or gotchas I need to be aware of before digging into the Foundation version? I don't want to get up to speed on Foundation and then find out that the Server edition (the version that will be deployed) is vastly different.

View 2 Replies

Architecture :: N-tier, Configuration Info, Specifically Connection Strings?

Sep 29, 2010

I have an ASP.NET project which is pretty n-tier, by namespace, but I need to separate into three projects: Data Layer, Middle Tier and Front End.I am doing this because...

A) It seems the right thing to do, and

B) I am having all sorts of problems running unit tests for ASP.NET hosted assemblies.

Anyway, my question is, where do you keep your config info?Right now, for example, my middle tier classes (which uses Linq to SQL) automatically pull their connection string information from the web.config when instantiating a new data context.If my data layer is in another project can/should it be using the web.config for configuration info?If so, how will a unit test, (typically in a separate assembly) provide soch configuration info?

View 3 Replies

Web Forms :: Saving Connection String In The Registry

Apr 8, 2013

The advantage of saving the connection string in the registry ....

The difference name and id in input ....

View 1 Replies

Visual Studio :: Connection Property Error The Connection Property In The Web.config File Is Missing Or Incorrect In VWD 2010?

Apr 18, 2010

When I open an ASP.NET 3.5 project using VWD2010, I get a prompt error message,"The connection property in the web.config file is missing or incorrect.The connection string from the .dbml file has been used in its place."however, my project works successfully.

View 1 Replies

VS 2010 - Saving Contents Of DIV As Image

Oct 3, 2012

I'd like to know how to do it myself. Surely you can grab something from the html or something?

View 1 Replies

VS 2010 - Saving And Retrieving Image

Nov 16, 2011

I have a very simple app here. It pulls a users picture from AD, saves it and then displays it as an asp:Image. The program runs perfectly in the IDE but fails after I publish it and try to browse to it. Here's the code and the error.

Default.aspx code.

Code:
<%@ Page Title="Home Page" Language="vb" MasterPageFile="~/Site.Master" AutoEventWireup="false"
CodeBehind="Default.aspx.vb" Inherits="WebApplication3._Default" %>
<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
<asp:TextBox ID="TextBox1" runat="server" Width="247px"></asp:TextBox>

[Code]....

View 8 Replies

Security :: Saving Stored Procedure Names And Connection Strings In Config Files

Aug 3, 2010

I have heard that saving connection strings and stored procedure names in web.config file of our application is not safe. It is a good practice to store the connection string in a config file rather than as a hard coded string in our code and if we need to change it,then it makes our job easier. how to protect our code in web.config?

View 4 Replies

VS 2010 - Display Alert To User After Saving In Database

Nov 11, 2012

I'm New In Asp.net , And I Wanna to know how can i display an alert to the user that inform the saving operation was done successfully and refresh the page to clear all the textboxs in the form to insert a new record in database ??

View 3 Replies

VS 2010 Verifying That Connection Is SSL?

Oct 12, 2010

I am building a user control for other programmers that I work with. It will be used to interface with our Authorize.Net accout. Is there a way in code to verify that the connection is SSL? If it isn't I'm going to disable the code to keep any of our programmers from accidentally trying to use the user control on a page that isn't SSL.

View 3 Replies

Web Forms :: "using" Statement Always Be Used When Creating A Connection To And Accessing Or Saving?

Jan 9, 2011

I have the following code in vb codebehind for updating, inserting, and reading from an sqldatabase using the "Using" statement. I have noticed in some forums where instead of using "Using Objconnectin as New SqlConnection", a plain declaration such as "Dim objConnection as New SqlConnection" is used. What is the difference in just declaring them and using the "Using" statement. Also, are the following approaches correct. First the DataReader:

Try

[Code]....

[Code]....

[Code]....

[Code]....

[Code]....

[Code]....

View 13 Replies

VS 2010 NHibernate Connection Configuration?

Jun 1, 2010

Seems one have to configure your connection a bit different in NHibernate configuration. In my web.config I'll have it like this (and it work):

Quote:

<add name="ApplicationServices" providerName="System.Data.SqlClient" connectionString="Data Source=72.118.116.71,1511;Initial Catalog=xxx;User Id=xxxx;Password=xxxx;" />
The sample I'm using (Trying to figure out NHibernate) configure a local database like this:

Code:

<property name="connection.connection_string">
server=.SQLExpress;database=NHibernateSample;
Integrated Security=true;
</property>
I've been trying various variations of this and cant get it to work:

Code:

<property name="connection.connection_string">
server=72.118.116.71,1511;database=xxxx;User Id=xxxx;Password=xxxxx;
Integrated Security=true;
</property>
Keep getting this errror:

The login is from an untrusted domain and cannot be used with Windows authentication."

View 3 Replies

ADO.NET :: Saving IQueryable In Cache Error "The ObjectContext Instance Has Been Disposed And Can No Longer Be Used For Operations That Require A Connection"

Oct 29, 2010

i want to save a IQueryable in cache like this:

[Code]....

However when i try to retreive it and use it i get this error: The ObjectContext instance has been disposed and can no longer be used for operations that require a connection.

View 5 Replies

VWD 2010 Connection To SQL Server Express 2008

Oct 6, 2010

i have designed a simple login page in VWD(login.aspx) . I have also added the connection to database option. Now i am stuck with adding connection strings in the web config file and also adding namespace.

View 2 Replies

VS 2010 - Change Connection String For Registration Form

Jun 20, 2011

I am trying to change the connection string for the registration form in VS 2010.

This is because it links to the local database in the App_Data which I need it to link to another database. I have changed the connection string in the webconig file and this works file for other forms I have created but does not allow me to create new users.

I have used the ASP.net 4.0 template when creating this website.

View 5 Replies

Databases :: Oracle Reside In Linux Server Connection From 2010?

Nov 25, 2010

I am starting a new project where I have to use oracle and asp.net. Oracle 11 enterprise edition. Problem is oracle database reside in linux server and application server is in windows. My question is1. Is there any problem connecting oracle from asp.net?

View 1 Replies

Create A Connection String Uning Visual Studio 2010?

Sep 6, 2010

How to create a connection string using Visual Studio 2010?

View 2 Replies

ADO.NET :: VS 2010 - No Entity Framework Or LINQ Support For SQL Server 2000 SQLOLEDB Connection?

Sep 1, 2010

I'm working with Visual Studio 2010 and for Data Connections am connecting to a SQL Server 2000 production database. When I try to drag a table to a .dbml file, the Object Relational Designer says, "The selected object(s) use an unsupported data provider." If I try to create an .edmx file via Generate from database, then the alert is, "This server version is not supported. You must have Microsoft SQL Server 2005 or later."

So VS 2010 has no support for the Data Entity Framework or LINQ when connecting to a SQL Server 2000 database? If that is the case, what is the best data access strategy for this scenario?

View 4 Replies

VS 2010 - Network Related Or Instance-specific Error Occurred While Establishing Connection

Jul 16, 2013

When I load the asp.net config tool in vs2010 it loads the page up fine but as soon as I click on security I get the following error:-

Code:

There is a problem with your selected data store. This can be caused by an invalid server name or credentials, or by insufficient permission. It can also be caused by the role manager feature not being enabled. Click the button below to be redirected to a page where you can choose a new data store.

The following message may diagnose the problem: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. I have tried a blank project with a login control on but get the same.

View 3 Replies

Visual Studio :: Error Unable To Add Data Connection. ExecuteScalar Requires An Open And Available Connection. The Connection's Current State Is Closed?

Sep 13, 2010

I'm using Visual Studio 2008, and my database is SQL Server 2000.

I want to add a connection to the Server Explorer in VS. The Data source is Microsoft SQL Server (SqlClient). After entering in all my information and I click Test Connection, it is successful.

But when I click OK, I get the error:

Unable to add data connection. ExecuteScalar requires an open and available connection. The connection's current state is closed.

View 3 Replies

MVC :: What Is The Best Approach To One To Many Relationships

Aug 5, 2010

What is the best approach to one to many relationships?

This is my scenario:

I have a simple one to many relation:

Customer
CustomerID
Name
tel
CustomerNotes
Id
Note
customerID

I want to have a DETAIL view of customers and CREATE view for CustomerNotes all in the same page.

I create CustomerController and the different views and its respective actions for edit, create, delete, etc.

I also create a CustomerNotesController and the views and actions like before, but I made the views PARTIALS

I put a RENDERPARTIAL for the CustomerNotes create view in the Details view from Customer.

When I run the app, the page is render as expected: It shows the detail info of the customer and bellow the create form for the notes. However, when I click SAVE, nothing happens. I put a breakpoint in the notes controller and never get hit.

I also try with RenderAction and don't work at all.

View 4 Replies







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