.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

VB code behind the Business Logic Layer ???

Posted By:      Posted Date: October 02, 2010    Points: 0   Category :ASP.Net

Hello. I was hoping for some general help and comments.

I went through a lot of the ASP.Net Web Forms Tutorials.

I also went though the whole "ASP.Net in 24 Hours" book by Scott Mictchell. I followed everything that went on in that book and built the final project successfully. I also used the tutorials here to better understand the whole Membership Provider/User tables setup that was going on in the book.

Next, I thought I would learn more about accessing data for ASP.Net since that is what most application do.

I went through the first Data Tutorial here. I seemed to understand what was going on just fine.

The second Data Tutorial seemed to just show a lot of VB code to build the Business Logic Layer. There was not much explanation about how to do it yourself.

I think I can keep going in the tutorials here. I downloaded the code from the second tutorial and went through it.I am guessing that the code in the second tutorial was given just to proceed with the overall project that is being built throughout the tutorial sequence.

I just wish I understood what is going on in those long lists of VB code. I can see some of what is going on. I don't know VB very well at all. So, what is the next step?

I have started working through a VB book. Will learning VB help me understand the code in that tu

View Complete Post

More Related Resource Links

Easy UI Testing: Isolate Your UI Code Before It Invades Your Business Layer


The User Interface Process Application Block (UIP) from the Microsoft Patterns & Practices team can help you isolate your UI, write unit tests for your UI logic, and write a UI that really is the thin layer it was always meant to be. Mark Seemann shows you how it's done in this article.

Mark Seemann

MSDN Magazine August 2005

Logic to calculate business hours


Hi All,

I have tried searching all over the web for this logic. Got many but half of them did not match what i was looking for and half were malfunctioning.

I want to calculate business working hours between 2 datetime, where in I should be able to set the working hours as well as weekends and holidays should not be calculated.


Please help me guys... It will be a great help... 

Know Thy Code: Simplify Data Layer Unit Testing using Enterprise Services


If you want to employ unit testing and test-driven development techniques in your database application development process, you'll have different factors to consider than you do when you're not involving a database. For example, you have to maintain a consistent state within the database and be able to roll back transactions when necessary. This article shows you how to get the best of unit testing for your database apps in a safe, usable manner.

Roy Osherove

MSDN Magazine June 2005

is there any impact of using static methods in Business Access layer in 3 tier applciation


is there any impact of using static methods in Business Access layer in 3 tier applciation,

Please suggest me what are the best practices and standards

Linq Ouery / Code / Logic for Finding Best Selling Products

Hello ExpertsPlease do reply as i am a beginner ..This is a table Named Products .. I want to show Best Selling products in a Datalist .. kindly tell me the logic for doing so by providing some examples or code by using LINQ ... Kindly help me .. [ProductId] [int] IDENTITY(1,1) NOT NULL,    [Name] [nvarchar](400) NOT NULL,    [ShortDescription] [nvarchar](max) NOT NULL,    [FullDescription] [nvarchar](max) NOT NULL,    [AdminComment] [nvarchar](max) NOT NULL,    [ProductTypeID] [int] NOT NULL CONSTRAINT [DF_Nop_Product_ProductTypeID]  DEFAULT ((1)),    [TemplateID] [int] NOT NULL,    [ShowOnHomePage] [bit] NOT NULL,    [MetaKeywords] [nvarchar](400) NOT NULL,    [MetaDescription] [nvarchar](4000) NOT NULL,    [MetaTitle] [nvarchar](400) NOT NULL,    [SEName] [nvarchar](100) NOT NULL,    [AllowCustomerReviews] [bit] NOT NULL,    [AllowCustomerRatings] [bit] NOT NULL CONSTRAINT [DF_Nop_Product_AllowCustomerRatings]  DEFAULT ((1)),    [RatingSum] [int] NOT NULL,    [TotalRatingVotes] [int] NOT NULL,    [Published] [bit] NOT NULL,    [Deleted] [bit] NOT NULL,    [CreatedOn] [datetime] NOT NULL,  

Best way to implement business logic

I am trying to migrate our current SQL CRM to Sharepoint Server 2010. At first I tried using BCS but I couldn't figure out how to implement a many-to-many lookup relationship. So now I am trying to use SSIS to move the SQL data into the lists in Sharepoint. Right now, I have accounts and contacts as lists. Now I am trying to implement the business logic where an account can have multiple contacts and a contact can have multiple accounts and when a user associates a contact with an account (or vice versa), that account should automatically be associated back with the contact. It seems this cannot be accomplished with a declarative work flow like in SPD. Am I correct in thinking that the best way to implement this is with 2 sequential workflows in Visual Studio?  Also, is a workflow always preferrable to an event receiver? Thanks!

How do i pass my datacontract into my business layer without a circular reference????

Ok, this architecture is fairly new to me, so I need a few good pointers.  I've searched the topic, but still don't have a clear understanding on what I'm missing.   I have a presentation layer, which displays my data and forms. I have a WCF service, a business layer and a dataAccess Layer I am trying to read data from on OLD!! foxpro .dbf file.  I've read all the articles on why not pass Datasets, etc so I'm trying to learn how to pass data contracts.  I have the following in my WCF [ServiceContract] public interface IService1 { [OperationContract] void SaveNDFData(string storedprocedure, ndfContractLibrary.NDFDataParam[] ndfData); <strong>[OperationContract] List<ndfContractLibrary.NDFDRawData> getRawNDFD();</strong> } I have a separate library for my dataContracts as i know later I will have several.  I'm using this as a generic List<> [Serializable] [DataContract] public class NDFDRawData { private int batchNumber; [DataMember] public int BatchNumber { get { return batchNumber; } set { batchNumber = value; } } private int sampleNumber; [DataMember] public int SampleNumber { get { return sampleNumber; } set { sampleNumber = value; } } private decimal invitroHour; [Da

Adding logic to the Search Core Results web part - Manipulation in code or XSL?

Hi,I need to manipulate the search core results web part, so that:- It will display a check box for each result- It Will have an additional button. When clicking on this button the checked results should be copied to a grid view.Do you have any idea how it can be done?I am not sure what is the correct way to do it – in the client side via the XSL Editor or in the server side with the C# code.Thank you so much for your help,Regards,SP beginner.

VWD Express Doesn't step into the Business Layer Function



I have a solution that consists of some web projects and websites (seperate projects in one solution) When I run the main project and debug I want to step into a function that resides in another project as a business layer function and then step into another function in DAL project. I set breakpoints in both projects (DAL and BLL) but am not able to step into those functions!!!

What is the problem with vwd express, It should support such vital thing. 

DataBinding not updating underlying business object when changing control property from code


I have a custom data form control that in code generates databindings between the selected custom business object (LLBL) and the various controls on the screen. Everything works in that I set the DataContext to the selected business object and the data appears in the GUI. If the user changes anything on screen, the data is getting updated into the business object.

However, now I have some custom logic that when the user presses a button I need to update some fields. Currently I'm setting this data directly into the controls, setting the new value into the property that is bound. However, the data is not getting pushed back into the business object.  I had this same issue building WinForm apps in that databinding only fired if the user was in the control and left it.

Does the same thing apply to WPF? How can I get ANY change on say a TextBox's Text property whether via user interaction or from C# code to push that value into the bound business object property?


Exposing business layer classes in the service (a lot of classes, all one-to-one with the service)


So I have a lot of classes in my business layer which may change over time and  I'd like to expose them in the service layer with as little work as possible. Exposing manually isn't something I want to do because every business class will have all of its properties exposed, meaning I'd be coding the same thing twice (and there are a lot of classes).

I saw an MSDN video where it was suggested writing a helper class but they didn't really delve in to how it would work.

Has anyone got any idea of how to go about this?

Many thanks,


Separate class library for controllers,models,repositories,business logic


Alright after scratching my mind for a while.. I still cant figure out how to go ahead with my architecture: http://forums.asp.net/p/1618613/4149672.aspx#4149672

nor i can find a decent link / info on it...So, iam goin to give this one more try.

Web Part remote update and centrally located business logic


Hi everyone,

We have a web application with a search engine that our customers want to integrate into their Sharepoint environment with automatic login. I'm not familiar with Sharepoint myself but have a question around the practicality of it. I realise that we have two options:

1. Display my web app in an IFRAME. The benefit of this approach is that my Sharepoint users will automatically benefit from any update made to the web app. The downside is that they cannot download any search results directly to their Sharepoint folders.

2. Create a full Web Part to "rebuild" the full user interface of my search engine for Sharepoint. The Web Part will access my web app through back-end APIs. The benefit of this approach is that users can download results directly into their Sharepoint folders. However a big downside is that anytime there's an update to the web app, I have to implement it separately on the Web Part and redeploy it. I'm discouraged by this because that means I have to update the Web Part on every customer's Sharepoint instance.


My question is. Is there option #3 that's a midway between option #1 and #2? Is there a way I can create a thin Web Part accessing "proxy" code that is centrally updateable without having to touch every Web Part deployment? Hopefully this option allows me to get the ben

How to use business logic in MVC



I've got a C# MVC 2 application using EF 4. My DAL project gets data from the Model, translates them into POCO's and returns ViewModels to the BLL which is called from the controllers.

I've set up validation attributes on the POCO classes and that works for "Required" fields etc. I would like to add business logic such as "From" has to be before the "To" date. Can this be done on the POCO classes so it is automatically validated client-side in the view?

Also, I would like to add some functionality to the BLL layer such as checking if a resource is already booked between the From and To dates to avoid double bookings. This should fire before the ViewModel is saved. I tried a Try/Catch statement in the controller so that I can throw an error in the BLL, but I don't understand how to return this error to the view with an appropriate error message added.



How much web layer input (ex. GridView DataKeys) should be validated in the business layer?


Back in the day when we were mostly submitting forms from one page to another we used to have to validate all post parameters to make sure that the ids somehow belonged to the user that was currently logged in.  After all you didn't want a "hacker" to be able to pull someone else's information.  In modern ASP.NET application in a situation where a lot of these keys are part of server controls (ex DataKeys of GridView) and is stored in ViewState which is supposedly stamped with a hash that gets validated on every post back, does anyone still validate that the key that was retrieved in fact belongs to the user?

I currently do, my business layer methods tend to take an instance of a "profile" object that is maintained in session for each user, the profile contains all basic information including the company etc. that the user is associated with.  Having the profile in every business method I can validate that any piece of information requested by the web layer from the business layer does in fact belong to the user requesting it.  Another thought is that the library (business layer) can also be reused outside of ASP.NET where perhaps the input would not be as secure.  I am wondering if all of this is overkill as all of my basic GetSomething() methods tend to have extra trips to the database to make sure that an ID

[Business Logic Handler debugging] - The assembly is not loaded by inetinfo.exe process


Hi there,

Here is my story - my merge replication topology consists of one publisher (sql server 2008), a distributor (same server as publisher) and a subscriber (sql server 3.5 CE). I use web synchronization for my merger replication. Publisher, Distributor, Subscriber and IIS run all on the same (development) machine. I use MSSMS to synchronize the subscriber.

I've created a custom resolver (Business Logic Handler) that should perform some data modification that has been inserted at the subscriber, before it is merged into the publisher. It should but it doesn't so I need to debug it to see what's going on. I've followed steps form here http://msdn.microsoft.com/en-us/library/ms365150.aspx on how to debug a business logic handler on a Web server using Web synchronization and I'm stuck at step 7. MY PROBLEM IS when I attache to inetinfo.exe process from VS2008, I don't see my assembly to be loaded neither in Output nor in Modules window and the break points say that they will not be hit because the symbols were not loaded.

I configured web synchronization almost exactly as it says here http://msdn.microsoft.com/en-us/library/ms151810.aspx , the only difference is that I didn't configured and

Server.MapPath dont have access to web all calls made in business layer


Hi Guys,

I'm trying to find a way to map a path to a pdf object in my business layer.. im using nop commerce and their messagemanager class is in the business layer and all calls to email queuing and the like are done in the business layer..

i would love to know if there's a way to do it without having the ability to pass the path in from the web layer..

my backup plan is an appsetting in web.config.. but hoped it wouldn't come to that?!

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend