Oop - Use Data Access Classes (Converting From ColdFusion)

Feb 17, 2011

We're converting from ColdFusion to ASP.NET 4.0 and we just don't know which route to take with setting up our classes.

In college I was taught to break everything up into separate Data Access Classes and Entity Classes that speak to the DAC. To me, that's the best option for a team that needs a lot of control over their classes and needs to reuse multiple items.

Then there is LINQ... Sure.. It's great and fast! I have no problems writing my own queries though. To me, it's not something I really need.

I would think we should be using folders that contain our DAClasses and folders that contain our Entity Classes. Then we would have our actual .aspx presentation pages.

View 1 Replies


Similar Messages:

C# - What Are The Pros/cons Of Choosing Between Static And Instance Data Access Classes In A Web App

Jan 20, 2010

I've read several other questions on this topic (here, here, and here), but have yet to see a great answer. I've developed my fair share of data access layers before and personally prefer to use instance classes instead of static classes. However, it is more of a personal preference (I like to test my business objects, and this approach makes mocking out the DAL easier). I have used static classes to access the database before, but I've always felt a little insecure in the appropriateness of such a design (especially in an ASP.NET environment).

Can anyone provide some good pros/cons with regards to these two approaches to developing data access classes with ADO.NET providers (no ORM), in an ASP.NET application in particular. Feel free to chime in if you have some more general static vs. instance class tips as well.

In particular, the issues I'm concerned about are:

Threading & concurrency
Scalability
Performance
Any other unknowns

View 4 Replies

DataSource Controls :: Converting Access Data To SQL (.mdf) Tables?

Jun 18, 2010

I have a set of MS Access data (tables); is there a simple way to convert to SQL (.mdf) tables?

View 2 Replies

How To Use A MembershipProvider To Carry Over Users' Session Data Stored In Cookies Set By ColdFusion

Feb 15, 2011

I'm working on adding a new webapp to an existing website. I've been directed to write the webapp in ASP.NET. The existing website is written in ColdFusion. For the most part, the ASP.NET webapp is completely stand-alone, but it needs to interact with the ColdFusion code in one important way - if somebody logs in to the ColdFusion site, we don't want them to have to log in again when visiting an ASP.NET page.

When someone logs in to the ColdFusion site, their username is stored in a cookie, along with a login token that can be looked up in our database. My .NET is a little rusty, so I'm having trouble visualizing how the ASP.NET code should use this data. I've already written a simple MembershipProvider that can be used to log in/out out the ASP.NET app using the data in our existing database tables, which are shared with the ColdFusion code.

What I'd like to know is - how can I make sure the ASP.NET app detects the cookies set by the ColdFusion app (I imagine they'd be sent to the ASP.NET pages, since everything is hosted on one domain), and automatically logs the user in using the MembershipProvider and Forms Authentication, using the credentials supplied in the cookie? I'm thinking that putting some kind of cookie check and log in function in the Global.asax file, set to run every page load for every page... but that seems kind of clunky. Also, do people still use the Global.asax file anyway? I had thought there was a more modern method.... Also, how can I manually log someone in using Forms Authentication and a custom membership provider? Currently my code allows the user to log in using the provided login control, but I'm not sure how to log the user in without them having to do anything.Looking over the MembershipProvider tutorials and the MSDN documentation it seems to me like the answer should be staring me in the face, but for some reason I just can't see it. Maybe not enough coffee....

View 3 Replies

Static Classes For Database Access?

Feb 8, 2010

I am using DataClassesDataContext to map all the tables from the db into my asp.net application.For doing CRUD operations i have made static classes with methods, and inside every method a instantiate DataClassesDataContext.For instance:

public static class UserQ
{
public static User getUserById(int userId)

[code]...

View 3 Replies

Unable To Access Classes From Different Files In VB.NET Website?

Jun 9, 2010

I've inherited a VB.NET website and it won't compile because the class1 in the file class1.vb refers to class2 in a file called class2.vb. I get the following error when trying to compile: Type Class2 is not defined.

When I look in the object browser the classes are listed separately (i.e. not all grouped under the same namespace) and appear as:

Public Class Class
Inherits System.Object
Member of C:...mywebsite [code]....

View 2 Replies

Web Forms :: How To Access Classes Or Their Members From App_Code Folder

Apr 27, 2010

I have a single project. and I have two folder in it. In the 1st folder I have a class named Class1 and in the 2nd folder I have a class named Class2. Can anyone tell me how I can access members of Class1 in Class2. I have tried by adding namespace in Class1 and Using that namespace in Class2. But it is giving error. It is easy to access classes or their members from App_Code folder. I don't want to put my classes in app_code folder.

View 5 Replies

Architecture :: Should Let External Classes Access Webform Controls

Sep 24, 2010

I was wondering if you should write code so that external classes and functions of that external class can access the webform controls in the main class???

Or should you only use the external class to process some data, return that data back to the main class (that instantiated that external class object) and then have an internal function in the main class to deliver the data to the control? (back to the screen)

View 2 Replies

Web Forms :: How To Access User Control From App_Code Classes

Jan 28, 2010

I have create a user control. now i want to crate instance of that user contorl in App_Code floder Class.

View 2 Replies

Visual Studio :: Unable Access To Classes From Other Folders Out Side Project Files

Jan 24, 2010

im facing problem to access classes out side my project folders. for example if i want to use some methods from store.vb file inside my project i get error : Name Space is not defiend, i have tried all ways such as import sdf.ITracjer.Data

[Code]....

i can't fetch the Store Class Methods or Function because its out of project directory, as its showin in image.

View 3 Replies

Consume WCF Service From Coldfusion 7?

Apr 20, 2010

consume a WCF service I have (wsdl) from Coldfusion. I need to pass values in the request header.

View 2 Replies

Reference A .NET Assembly From ColdFusion?

Feb 15, 2010

Is it possible to reference a .NET assembly from ColdFusion? If so, how can I accomplish this? I am not a ColdFusion developer by any means.

View 1 Replies

Peculiar Error With ColdFusion On BlueDragon.NET?

Nov 16, 2010

We've got an odd issue occurring with ColdFusion on BlueDragon.NET. Asking here because of the broad experience of StackOverflow users.

Tags inside POSTed content to out BlueDragon.NET server gets removed, and we're not sure where in the stack it's getting removed. So for example if we post this data

[CORE]
Lesson_Status=Incomplete
Lesson_Location=comm_13_a02_bs_enus_t17s06v01
score=
time=00:00:56
[Core_Lesson]
<sd ac="" pc="7.0" at="1289834380459" ct="" ><t id="lo8" sc=";;" st="c" /></sd>
<sd ac='' pc='7.0' at='1289834380459' ct='' ><t id='lo8' sc=';;' st='c' /></sd>
<sd ac="" pc="7.0" at="1289834380459" ct="" ><t id="lo8" sc=";;" st="c" /></sd>
<sd ac="" pc="7.0" at="1289834380459" ct="" ><t id="lo8" sc=";;" st="c" /></sd>

[Code]....

If we do this, and use the created BetterFORM variable, it's there, so it does not seem to be a problem with the requests being filtered at some other point in the stack. I was thinking maybe it was URLScan, but that appears not to be installed. Since BD.NET runs on .NET as the engine, perhaps there's some sanitization setting that is being used on all variables somehow?

View 2 Replies

Configuration :: Running .NET On A Server With ColdFusion?

Apr 8, 2010

getting these two to play together nicely? I've got ColdFusion 9 running fine, but whenever I try to access a .NET page I get a 500 error. I'm pretty sure this has to to with the custom handlers ColdFusion installs.

View 4 Replies

Visual Studio :: What Is The Difference Between Designer Classes And T4 Template Generated Classes

Jan 11, 2010

I am new to LINQ. when we drag tables we get a dbml file and designer file.

For example DataClasses1.dbml and DataClasses1.designer.cs.

Once we have them then we can start using our LINQ Queries.

In my company project I do not see this designer files and instead there are .tt files which were used as templates to greate ABC.generated.cs files. Is this same as designer class?

View 3 Replies

C# - Class Structure With LINQ, Partial Classes, And Abstract Classes

May 17, 2010

I am following the Nerd Dinner tutorial as I'm learning ASP.NET MVC, and I am currently on Step 3: Building the Model. One part of this section discusses how to integrate validation and business rule logic with the model classes. All this makes perfect sense. However, in the case of this source code, the author only validates one class: Dinner.

What I am wondering is, say I have multiple classes that need validation (Dinner, Guest, etc). It doesn't seem smart to me to repeatedly write these two methods in the partial class:

[code]....

This doesn't "feel" right, but I wanted to check with SO to get opinions of individuals smarter than me on this. I also tested it out, and it seems that the partial keyword on the OnValidate method is causing problems (understandably so). This doesn't seem possible to fix (but I could very well be wrong).

View 1 Replies

C# - Can Base Classes See The Protected Fields Of Derived Classes

Aug 11, 2010

I don't know if this has to do with how FindControl works or how scope works. But my base class is having a hard time seeing the fields of child classes. Currently I'm planning have the derived class set a property in the base class, but there are a lot of derived classes, so that isn't a very attractive solution.

[code]....

View 4 Replies

State Management :: How To Pass Session Variables From .net To Coldfusion

Sep 21, 2010

We are in the process of refactoring from cf to .net, so, I am working on the Login page and converting it from cf to .net. So, when I am autheticated and enter into our website, I need to redirect it to a cfm page (just temporary, since we will be refactoring that also eventually).

So, I am autheticated (using CustomMembership Provider model for sql server) and then when I redirect to the cfm, the app.cfm should validate the .net session variables. Here is where i am stuck:

I have the .net session variables in the aspx side:something like Session["UserId"].ToString() = Value from a login txt box (also authenticated against data in the database)

Session["UserName"].ToString() = Value from the db corresponding to the User Name entered in the text box.

So, now I have all the session variables in the .net side. Now, how do I retreive these .net session in the cf side? Any small peice of code to retrive the asp.net session variable in the application.cfm side would be great.

View 4 Replies

Web Forms :: Using C# Classes Vb Classes Together In VS2008 / 3.5 Project

Mar 24, 2010

Can I use VB and C# classes together in the same asp.net 3.5 project?

View 3 Replies

Map Model Classes To ViewModel Classes Or Aggregate Model Classes In ViewModel Classes

Dec 15, 2010

I'm curious as to what people consider better practice, between duplicating model structure in the view model and using a mapping tool to move data between the two, or aggregate the model inside the view model, i.e. have a property on the view model class that is a reference to the actual model. Which is considered a better approach in general?

View 1 Replies

HTTP POST, Redirect To JSP/ColdFusion,best Server Side Or Client Side?

Jan 25, 2010

I want to post data to another server (JSP or ColdFusion).

Note:Post which means the data is required at the another server also the browser should be redirected automatically.Is it better to use form tag...input type hidden fields, values...

and from javascript

form.submit();

[code]...

I should use WebClient class?Please provide the points from Security view also.

View 1 Replies

Data Controls :: Insert Data Using JSON And JQuery Using Business Classes

Oct 21, 2015

I used this article Insert (Update) Data to Database with jQuery AJAX and WebMethod in ASP.Net. I want create class for this code:

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript" src="http://cdn.jsdelivr.net/json2/0.1/json2.js"></script>
<script type="text/javascript">
$(function () {
$("[id*=btnSave]").bind("click", function () {
var user = {};

[Code] ...

And call class from button click.

View 1 Replies

Mvc - None Of The Generated Classes From Subsonic For Data Are Available

Jul 28, 2010

I have an MVC project setup, and I've brought the subsonic Active Record templates into my project, and they generated successfully and I can use the subsonic classes to access my database. However, how do I create a strongly typed view using the subsonic generated classes? When I select "add View" and I check the checkbox to create a strongly-typed view, none of the generated classes from subsonic for my data are available.

View 2 Replies

Could/Should Use Static Classes In C# For Shared Data?

May 7, 2010

I'm building an online system to be used by school groups. Only one school can log into the system at any one time, and from that school you'll get about 13 users. They then proceed into a educational application in which they have to co-operate to complete tasks, and from a code point of view, sharing variables all over the place.

I was thinking, if I set up a static class with static properties that hold the variables that are required to be shared, this could save me having to store/access the variables in/from a database, as long as the static variables are all properly initialized when the application starts and cleaned up at the end. Of course I would also have to put locks on the get and set methods to make the variables thread safe.

Something in the back of my mind is telling me this might be a terrible way of going about things, but I'm not sure exactly why, so if people could give me their thoughts for or against using a static class in this situation,

View 1 Replies

MVC :: Data Annotation W/ Linq To SQL Generated Classes?

May 14, 2010

Technically I have the Data Annoations working with Linq to SQL classes - the problem is when validation
passes. When UpdateModel() tries to do its thing i can an error:The model of type 'MyProject.Models.Employee' could not be updated.What i did was i created a partial class for Employee (that is generated by linq to sql), then stuck a Meta Data class on top of it for the validation

[Code]....

And in my master page i include

<script type="text/javascript" src="/Scripts/jquery.validate.min.js"></script>

View 9 Replies







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