locked
getting start asp.net & c# RRS feed

  • Question

  • User-1075092149 posted

    I am getting start to use asp and c# to write a program, but i don't know the design structure that i can develop my program.

    when i design the interface in aspx and typing code behind.

    but how can i design the datatbase layer so that i can sparate the file from each file

    is the best design is 1 interface 1 database? or just 1 database layer is OK?

    can anyone provide a simple template so that i can develp from the base.

    Sunday, February 7, 2010 7:11 AM

Answers

  • User-1535021499 posted

    To start with go through the tutorials and Videos on the home page...<o:p></o:p>

    good books to refer are <o:p></o:p>

    1. 3.5_Step_by_Step
    2. ProgrammingMicrosoftASP.NET-3.5<o:p></o:p>
    3. Sams_ASP_NET_Unleashed<o:p></o:p>

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, February 9, 2010 6:31 AM
  • User2130758966 posted

    rtpHarry- 

    The best way to do it is something called n-layer design (sometimes mistakenly referred to as n-tier).

    I agree on the premise of that statement, but I think the term 'n-tier' can be used interchangeably safely in most conversations; it certainly is the more commonly used term in our industry when referring to this style of architecture. I do agree though that in strictly technical speak, Tier = Physical , Layer = Logical.  I myself have heard Rocky Lhotka (the gentleman referred to in the link you provided) speak at VSLive! Conferences on more than one occasion, and the important point to explain is the difference between an n-tier 'logical' structure and an n-tier 'physical' structure.  I have posted about this very difference here:

    3 tier Architecture:

    http://forums.asp.net/p/1511760/3604157.aspx#3611556

    The above link also has links within that will help the original poster with this architecture. 

    yeah I had to look it up to be remind myself which was supposed to be which. I think I use the word tier more often as well. I just wanted to get it "right" as the user was theoretically just being introduced to the topic.

    I gave your link a quick read over and it seems like a fair introduction to the subject. I havecome across Rocky before but I haven't put any of his books in my wish list because I figured he took a vastly different approach to things and I didnt have time to learn another new methodology. I will probably take another look at this?

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, February 9, 2010 6:27 PM
  • User-952121411 posted

    I havecome across Rocky before but I haven't put any of his books in my wish list because I figured he took a vastly different approach to things and I didnt have time to learn another new methodology. I will probably take another look at this?
     

    Yeah if you get some time, I would recommend it. I think Rocky is a great leader in this industry, and has done a nice job with his CSLA.NET Framework.  I have his book titled: Expert VB 2005 Business Objects. I believe there are now '2008' versions of the books as well (C# and VB.NET). The book speaks generically about OOP, but also spends a lot of time relating it to the CSLA Framework.  His CSLA site can be found here:

    http://www.lhotka.net/cslanet/

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, February 10, 2010 9:23 AM

All replies

  • User2130758966 posted

    The best way to do it is something called n-layer design (sometimes mistakenly referred to as n-tier).


    The tutorials on this site provide an introduction to these concepts in a roundabout way:

    The data access technology it uses (Strongly Typed Datasets) is an old technology that isnt really used any more but it will give you the concepts behind separating your code and also it will introduce you to all of the different controls you will be using time and time again. I think its a valuable introduction to asp.net still and the actual data access code is usable and then can be replaced with a new technology such as linq 2 sql or entity framework when you have learned the basics.

    Sunday, February 7, 2010 9:22 AM
  • User-1075092149 posted

    I am afraid that I write all the methods , which contain the sql statement to do insert,update,delete function in different methods within ONE cs file that is store in another file apart from the interface file.(using sqlcommand)

    is there any development problem?

    my struction is same as below:

    -DAL folder

      -connectionDB.cs   <- ONLY ONE CS FILE

    -program folder

      -registrater.aspx

      -userProfile.aspx

     

     

     

    Sunday, February 7, 2010 11:48 AM
  • User78336405 posted

    Hi,

    Check this book first:ASP.NET 3.5: Application Architecture and Design: Build robust, scalable ASP.NET applications quickly and easily . And then you will get the answer. 

    Tuesday, February 9, 2010 2:19 AM
  • User-1636183269 posted

    Hello,

    Asp.net contains some important videos to start just go through this section, same requirement you can leasn from here. Second tab in menu :)

    http://www.asp.net/get-started/


    Tuesday, February 9, 2010 2:29 AM
  • User2130758966 posted

    I am afraid that I write all the methods , which contain the sql statement to do insert,update,delete function in different methods within ONE cs file that is store in another file apart from the interface file.(using sqlcommand)

    is there any development problem?

    my struction is same as below:

    -DAL folder

      -connectionDB.cs   <- ONLY ONE CS FILE

    -program folder

      -registrater.aspx

      -userProfile.aspx

    This is better than putting it all in the actual page code behinds like some people do. Or worse still right in the markup with a SqlDataSource.

    At least you aren't mixing your code up too bad.

    You should carry on learning along this line though to better compartmentalise your data layer because putting the whole thing in one file will lead to a very big file! Ideally you should have lots of little files with different classes in and each class should do one unit of work. So for me I normally split it up like a file for each table in the database, a file for managing my email sending, and other files depending on which extras I am developing for that project.


    Tuesday, February 9, 2010 5:27 AM
  • User-1535021499 posted

    To start with go through the tutorials and Videos on the home page...<o:p></o:p>

    good books to refer are <o:p></o:p>

    1. 3.5_Step_by_Step_0735624267<o:p></o:p>
    2. ProgrammingMicrosoftASP.NET-3.5<o:p></o:p>
    3. Sams_ASP_NET_Unleashed<o:p></o:p>

     

    Tuesday, February 9, 2010 6:31 AM
  • User-1535021499 posted

    To start with go through the tutorials and Videos on the home page...<o:p></o:p>

    good books to refer are <o:p></o:p>

    1. 3.5_Step_by_Step
    2. ProgrammingMicrosoftASP.NET-3.5<o:p></o:p>
    3. Sams_ASP_NET_Unleashed<o:p></o:p>

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, February 9, 2010 6:31 AM
  • User-952121411 posted

    rtpHarry- 

    The best way to do it is something called n-layer design (sometimes mistakenly referred to as n-tier).

    I agree on the premise of that statement, but I think the term 'n-tier' can be used interchangeably safely in most conversations; it certainly is the more commonly used term in our industry when referring to this style of architecture. I do agree though that in strictly technical speak, Tier = Physical , Layer = Logical.  I myself have heard Rocky Lhotka (the gentleman referred to in the link you provided) speak at VSLive! Conferences on more than one occasion, and the important point to explain is the difference between an n-tier 'logical' structure and an n-tier 'physical' structure.  I have posted about this very difference here:

    3 tier Architecture:

    http://forums.asp.net/p/1511760/3604157.aspx#3611556

    The above link also has links within that will help the original poster with this architecture. 

    Tuesday, February 9, 2010 2:33 PM
  • User2130758966 posted

    rtpHarry- 

    The best way to do it is something called n-layer design (sometimes mistakenly referred to as n-tier).

    I agree on the premise of that statement, but I think the term 'n-tier' can be used interchangeably safely in most conversations; it certainly is the more commonly used term in our industry when referring to this style of architecture. I do agree though that in strictly technical speak, Tier = Physical , Layer = Logical.  I myself have heard Rocky Lhotka (the gentleman referred to in the link you provided) speak at VSLive! Conferences on more than one occasion, and the important point to explain is the difference between an n-tier 'logical' structure and an n-tier 'physical' structure.  I have posted about this very difference here:

    3 tier Architecture:

    http://forums.asp.net/p/1511760/3604157.aspx#3611556

    The above link also has links within that will help the original poster with this architecture. 

    yeah I had to look it up to be remind myself which was supposed to be which. I think I use the word tier more often as well. I just wanted to get it "right" as the user was theoretically just being introduced to the topic.

    I gave your link a quick read over and it seems like a fair introduction to the subject. I havecome across Rocky before but I haven't put any of his books in my wish list because I figured he took a vastly different approach to things and I didnt have time to learn another new methodology. I will probably take another look at this?

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, February 9, 2010 6:27 PM
  • User-952121411 posted

    I havecome across Rocky before but I haven't put any of his books in my wish list because I figured he took a vastly different approach to things and I didnt have time to learn another new methodology. I will probably take another look at this?
     

    Yeah if you get some time, I would recommend it. I think Rocky is a great leader in this industry, and has done a nice job with his CSLA.NET Framework.  I have his book titled: Expert VB 2005 Business Objects. I believe there are now '2008' versions of the books as well (C# and VB.NET). The book speaks generically about OOP, but also spends a lot of time relating it to the CSLA Framework.  His CSLA site can be found here:

    http://www.lhotka.net/cslanet/

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, February 10, 2010 9:23 AM
  • User-1714761813 posted

    It says a lot that you suspect you might need a little direction in this area but I wouldn't get too caught up in looking for THE ONE correct way to build your app.  There are a lot of factors that would need to be considered and DALs can get really set you back if your a beginner and the app is small.  I highly recommend beginners writing out the connectors and objects by hand as much as they can.  It will really help when debugging and optimizing later. 

    So having said that, I'd say read up as recommended but go ahead and start with your data class and build from there.  Unless you've got a lot of the app mapped out (which I doubt you do - no offence) It would be a good exercise to build a small DAL yourself.  If in the future you see the need to add a proper DAL then do so.  But I think your headed down the right path.  Microsoft has gone to great lengths to hide a lot of the wiring, which is great when you need to crank out the code but let's all admit it - to get paid good money you debug old code not write new.

    Wednesday, February 10, 2010 3:26 PM