Architecture :: Using DataSets Alongside Linq To SQL Classes?
Feb 22, 2010
I am updating a project I wrote some time ago. At the time my preference was for DataSets and DataSetTableAdapters, but I've now moved on to use Linq to SQL DataClasses. I would like to convert the project to Linq to SQL, but I am tight on time and it's a big job. My question is, is there any reasons I can't develop new modules using Linq to SQL DataClasses along side DataSets and convert the DataSets overtime?
Apart from the obvious confusion it will cause, are there any technical problems I should be aware of i.e. will there be any performance problems using the two methods?
View 4 Replies
Similar Messages:
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
Feb 18, 2010
i am using datasets as part of my web application architecture.
i have one dataset which has two tables which are populated from database . everything works fine but when i have change in stored procedure. i change structure of datatable in dataset file after that compilation errors start to throw up. when i check cs file of dataset it shows multiple classes with different names.
cant get into it. since im using datasets for first time. its getting frustating.
View 4 Replies
Aug 29, 2010
I am using ASP.NET (C# and sql server express 2005) for my web application project. I have three related tables. I want to do an insert using typed datasets,tableadapters and three tier architecture. I wish to know how to do simultaneous inserts in 3 tables. So i wish to insert a row in first table and get its primary key. Same with the second table. I will use the primary keys of those first two tables to do the insert in the third table. How can i accomplish this using formview control and what methods should i use??
View 3 Replies
Mar 9, 2011
I'm implementing n-tier structure in the current app I'm working on. Because DataBinding a list of my Objects to a Repeater was far too slow I need to databind a DataTable to the Repeater. Should I still DataBind to a Function (that returns a DataTable) in the BLL that calls a Function in the DAL that returns a DataTable?
View 2 Replies
Nov 29, 2010
1. Desktop based application - Developed in VB2. Web based application - Developed in Asp.Net 2.0 and C#The above two uses same database in SQLI do have proper class library/business logic in desktop based application in VB. Now I need to use the same library in ASP.net web based application so that I can change at one place and both the versions will work fine with replacement of one dll.hat is the best to make classes in VB, VB.NET OR C# so that I can use at both end easily.1. If I write Activex dll in vb, the internet articles tells about low performance because of Interop services.
View 2 Replies
May 12, 2010
I want to know Can an assembly contains more then one classes?
View 1 Replies
Nov 24, 2010
I have a third party dll and i need to add some more functionalities (methods, constants etc..) so create a wrapper class. I have no idea about wrapper classes. what is the purpose of this and how to create in .NET for this 3rd party dll.
View 6 Replies
Mar 21, 2011
I got loads of website, that share one of two baseclasses. I need the two baseclasses to be able to share part of the same code. I dont want to have to duplicate the shared code per baseclass.
so.. I got a page.aspx that inherits the baseclass and that inhertis 'sub' baseclass that inherits the web.ui.page class. So far so good :-)
In my baseclass I got a Public (at the top of the class not in any method- not sure of the proper term) Varable that is constructed from a structure in the BO class.
it Public PageDetails AS CoreDomainSetupBO.GetStartUpDetails = {database method}
I need the pagedetails to be available in the sub baseclass but it cant be defined there as the page details value is defined differently in the different base classes.
I hope that makes sense, I need to sub base class to be able to use a property that is defined at baseclass level.
View 3 Replies
Dec 3, 2010
I am looking for general direction on the best practice here. I have a class that I want to share between two different forms in two projects that are associated. The two forms are in seperate projects but both projects load together as I have added the second project to the first. I also have a class that I want to share between these two projects which will cause me to add another project to this solution with will mean I will have three projects in my solution. My question is how do I best share this class?
I believe the only way to do this is to add the class in the reference in both of the form projects?... Is this correct ? I'd really like to just reference the class and inherit it in the source code without adding it as a reference but I am feeling that I can't do that. I am obviously pressed for time and working on other projects and a I am a experienced coder with only about 1 year of C# experience...
View 4 Replies
Aug 10, 2010
I am searching for what are the standard best practice (for OOP) used to design classes for develop asp.net application? I am aware of most of the OOP concepts but confused with how to map object/classes.
Let's take example of Adventure works - 2005 database provided by Microsoft; it has five schemas Sales, Purchase, Person, Production, HR and DBO.
Should we consider Schemas as Namespace in Classes?
Now, Person schema has 5 tables, should we design classes based on tables?
i.e. Person schema has Address, AddressType, Contact, ContactType, CountryRegion & StateProvince tables. What are the classes we can consider?
What are the basic criteria to decide objects? What to do and how to design classes for tables like Purchase order detail, Product cost history, Product inventory, Product Category etc.
View 3 Replies
Nov 3, 2010
Can we use membership class in 3 tier architecture? Actually i want to use ASP.NEt's login control and membership for authentication. Can it will be possible in 3 tier using membership.
View 5 Replies
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
Dec 23, 2010
where to create the BLL and DAL and all classes in it can we place them in the App_code folder as it ll convert them into DLL Files or do we have to create a new class library project for each...
View 1 Replies
Mar 24, 2011
My MVC ASP.NET web application is split up like this:
Web Application Layer Views
[Code]....
Now, I have a view in the database called "EquipmentWithCableDetails", which contains additional useful information with the equipment details - so I create a class to model that view (in order to be able to read from it). In the code I have that works with that new class, I want to display the EquipmentDescription - but that property only exists on the Equipment class.
View 2 Replies
Feb 1, 2011
I am using the ADO.NET Entity Framework for loading data from the database. The classes are directly mapped to database tables in the database. The problem is that these classes are not optimal for binding to the UI elements. As a result of this I have some custom entities which are populated at the service layer and returned. It is these custom entities (classes) to which I bind the UI elements. My questions on this are1. Is populating these entities at the service layer the most appropriate way to do this. I personally do not think so because if we introduce some additional UI elements which need different entities then I have to modify the service layer again.2. What is the best approach/pattern to get this done.
View 2 Replies
Jan 11, 2010
So I started working on my first asp.net application that involves logging in and databases, and soon after i started messing around with a static class. I "discovered" that if you make a variable static, all sessions share that variable (I for some reason was originally assuming that each session had its own copy of that "static" class). Anyway, after discovering this I thought to myself "how could this possibly be useful to me" and thought that itmight be a good idea to make a single static database connection for all of the sessions, rather than storing that as a session variable for each session. Does anybody know what would be the pros and cons of this approach?
View 5 Replies
Feb 12, 2010
For no apparent reason (of course there must be one), my web project will no longer generate LINQ to SQL classes/data contexts!!!I am going about the usual routine of right clicking the project, adding new item, selected LINQ to SQL classes, then dragging over a table from Server Explorer, saving and build but no...the bloody thing won't appear!!!Does anyone know why this might be happening/what have I done wrong?
View 1 Replies
Jul 16, 2010
Database backed entity classes and matching the underlying types for the ID field. removed.
View 1 Replies
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
Aug 16, 2010
I'm building a web app that will keep a events in a database and add the event to a Google calendar on insertion.
I have three types of events, PendingEvents, ApprovedEvents, and DeniedEvents. I'm using single table inheritance through LINQ-to-SQL, with the Event class being abstract and the 3 types inheriting from it
Each type of Event is stored in calendars differently. I would like to use an abstract member function in Event called AddToCalendar.
I'm trying to set this up in a separate class file because I'm using the LINQ-to-SQL designer and I don't want these to be overwritten if I change the LINQ diagram.
However, I get an error from all three inherited classes that "'WebCal.ApprovedEvents' does not implement inherited abstract member 'Edu.Northwestern.WebCal.Event.AddEventToCalendar()' WebCalendarWebApplication1App_CodeWebCalDataSource.designer.cs"
It looks like it won't check my outside file and only looks at the designer.
The non-designer partial class file looks something like this:
public partial class WebCalDataSourceDataContext : System.Data.Linq.DataContext
{
View 2 Replies
Jan 21, 2011
Is it possible to create a table class that can be used for multiple tables? For example, if I have some class:
[Code]....
In LINQ to SQL, this maps to a table with a name based on the class name, DBClass. However, suppose I want to use that class for multiple tables, and it could be an arbitrary number of tables. Is this possible
View 3 Replies
Apr 6, 2010
Is there anyway I can extend LINQ classes through different namespaces?Typically in my class libraries I have a namespace for each class object and their associated DAO and service classes in a folder of my project, therefore on the front-end I can only use the namespaces associated with the given page and not clutter my intellisense or load in a bunch of excess stuff.
However, I have found that upon adding my .dbml LINQtoSQL file, whatever namespace that is in, whether it's the project root namespace or a custom one, is the only namespace I can use partial class extension in.I have tried even creating a custom workspace (placing the .dbml file in a folder) and then including a using statement to that namespace and I still cannot extend the partial classes.Is there anyway I can do this? Or to have the .dbml file count as being in every namespace? I don't want to remove all namespaces but the root one either.such when I try doing the partial class from a different namespace I get the following error:
Error 1
'Id' is not a member of 'LCFVB.EntityNS.Entity'.
C:Usersshol726.UILAWDocumentsVisual Studio 2008ProjectsLCFVBEntityNSEntity.vb
10 7
LCFVB
View 7 Replies
Apr 26, 2010
I came across the article few days ago where somebody said that it's possible to automatically break down ClassName.Designer.CS into multiple classes.
So instead of having Customer and Order class definitions in one .CS file I'm going to have 2 .CS files: Customer.Designer.CS and Order.Designer.CS
View 1 Replies
Mar 17, 2011
I can't believe I'm having so much trouble finding this information. I'm endeavouring to learn about creating model classes with Linq to SQL. By default VS2010 wants to use SQL Express, but our organisation has several database servers for development so I'd rather use one of those. PLEASE can somebody tell me how I can configure VS2010 to do that, as all I get is 'A network-related or instance-specific error occurred while establishing a connection to SQL Server ... Verify that the instance name is correct'. Yeah, thanks Microsoft. Actually telling me how to verify the instance name would be a really good move here.
View 1 Replies