Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Why is this so complicated in ASP.NET?

Options
  • 17-09-2008 12:18pm
    #1
    Closed Accounts Posts: 7,097 ✭✭✭


    Here we go, the task is the simplest you could dream up... I have a webform called default.aspx, with 5 drop down list controls and 2 textbox controls, I've created using MS Visual Web Developer. I have a MS SQL 2005 database with a table and 7 columns.

    All I want to do is get 7 pieces of data from my website, to be added into my database when a user hits the submit button.

    Previously when doing this task with PHP, this task seemed simple and straightforward, I posted the data from a HTML page into a PHP page and from there it was handled into the database.

    With ASP, this seems to be an unnessarily convoluted task, I just want to add data to a database, and I'm finding it hard to believe that this is not actually a simple task??? Basically, database set up and access, no problem, webform creation, no problem, but what is the story with the bit in the middle, why is it so complicated!?!?!?!

    Believe it or not, I've watched more video tutorials on asp.net this week in an effort to crack this and last week and there is nothing on that website about adding data to a database, every tutorial is based on reading/filtering/sorting data that is already on a database...???


«13

Comments

  • Registered Users Posts: 21,257 ✭✭✭✭Eoin


    What part exactly is complicated? ASP.Net is not a scripting language (and it's not ASP either, so best not to confuse the two), so of course there's going to be a learning curve. I don't even find it that cumbersome for small applications either.

    I've not used Visual Web developer, but if it's similar to Visual Studio then try something like this.

    Bear in mind that this is not tested and is just off the top of my head. If it does happen to work, then it's far from best practise, but may be enough to get you started.

    The ASPX page:
    [html]
    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="page.aspx.cs" Inherits="page" %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;

    <html xmlns="http://www.w3.org/1999/xhtml&quot; >
    <head runat="server">
    <title>Untitled Page</title>
    </head>
    <body>
    <form id="form1" runat="server">
    <div>
    Dropdown list 1: <asp:DropDownList ID="DropDownList1" runat="server"><asp:ListItem Value="1" Text="1" /></asp:DropDownList><br />
    Dropdown list 2: <asp:DropDownList ID="DropDownList2" runat="server"><asp:ListItem Value="1" Text="1" /></asp:DropDownList><br />
    Dropdown list 3: <asp:DropDownList ID="DropDownList3" runat="server"><asp:ListItem Value="1" Text="1" /></asp:DropDownList><br />
    Dropdown list 4: <asp:DropDownList ID="DropDownList4" runat="server"><asp:ListItem Value="1" Text="1" /></asp:DropDownList><br />
    Dropdown list 5: <asp:DropDownList ID="DropDownList5" runat="server"><asp:ListItem Value="1" Text="1" /></asp:DropDownList><br />
    <p />
    TextBox 1: <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox><br />
    TextBox 2: <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
    <p/>
    <asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" />
    </div>
    </form>
    </body>
    </html>
    [/html]

    The code behind page (C#):
    using System;
    using System.Data;
    using System.Configuration;
    using System.Collections;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;
    using System.Data.SqlClient;
    
    public partial class page : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
    
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            string dropdown1 = DropDownList1.SelectedValue;
            string dropdown2 = DropDownList2.SelectedValue;
            string dropdown3 = DropDownList3.SelectedValue;
            string dropdown4 = DropDownList4.SelectedValue;
            string dropdown5 = DropDownList5.SelectedValue;
    
            string textbox1 = TextBox1.Text;
            string textbox2 = TextBox2.Text;
    
            string sql = "insert into tablename(column1, column2, column3, column4, column5, column6, column7)\n";
            sql += "values(";
            sql += "'" + dropdown1 + "',";
            sql += "'" + dropdown2 + "',";
            sql += "'" + dropdown3 + "',";
            sql += "'" + dropdown4 + "',";
            sql += "'" + dropdown5 + "',";
            sql += "'" + textbox1 + "',";
            sql += "'" + textbox2 + "'";
            sql += ")";        
    
            SqlConnection conn = new SqlConnection("Your Connection String");
            conn.Open();
            SqlCommand cmd = new SqlCommand(sql, conn);        
            cmd.CommandType = CommandType.Text;
            cmd.ExecuteNonQuery();        
            conn.Close();
        }
    }
    


  • Registered Users Posts: 3,548 ✭✭✭Draupnir


    What language do you want to use in your code behind to access the database? Realistically any ASP.Net project you are working on should reference a separate data access layer project, I would recommend that you write this in C Sharp.

    Is it the fact that you need to have an intermediary layer to access the database that is bothering you? Or the fact that you can't just do it from a page?

    In my opinion, writing to a database from a web page is a terrible idea anyway and creates insecure and poorly designed software.


  • Registered Users Posts: 21,257 ✭✭✭✭Eoin


    Draupnir wrote: »
    In my opinion, writing to a database from a web page is a terrible idea anyway and creates insecure and poorly designed software.

    Yes, as I said, that was just to get him started. If this is more of a personal website than "software", then creating a business logic tier could be overkill at this stage.


  • Registered Users Posts: 3,548 ✭✭✭Draupnir


    The code you provided will work perfectly well if the chap wants to get off and running in the world of ASP.Net development, fair play on that score.

    I'd just hate him to leave this thread thinking that it was in any way, shape or form the right way to go about ASP.Net application development!

    It's a personal bug bear, but front end code should never be anywhere near your database!


  • Registered Users Posts: 21,257 ✭✭✭✭Eoin


    I'm still not sure this is for a career in application development though - the OP seems to have some connection with the motor trade, given his posts in the motors forum.


  • Advertisement
  • Closed Accounts Posts: 52 ✭✭zardette


    Draupnir wrote: »
    What language do you want to use in your code behind to access the database? Realistically any ASP.Net project you are working on should reference a separate data access layer project, I would recommend that you write this in C Sharp.

    Is it the fact that you need to have an intermediary layer to access the database that is bothering you? Or the fact that you can't just do it from a page?

    In my opinion, writing to a database from a web page is a terrible idea anyway and creates insecure and poorly designed software.

    +1

    ....never mind this is very prone to sql injection ... something that one is exposed to in any language . There are loads of books
    http://www.sitepoint.com/article/asp-dot-net-introduction/
    and websites that cover this google it !

    http://en.csharp-online.net/ASP.NET_Security_Hacks%E2%80%94Avoiding_SQL_Injection


  • Registered Users Posts: 21,257 ✭✭✭✭Eoin


    In case I didn't make it clear enough, that code was purely just to show how to get the information submitted in the form into the database.

    Edit: Incidentally, what do you guys think of all those open source packages like OSCommerce and Zencart that have very tightly coupled markup and business logic?


  • Registered Users Posts: 3,548 ✭✭✭Draupnir


    I wouldn't use any third party libraries like those myself, I don't like the idea of exposing my to the security policies or lack thereof within them.


  • Closed Accounts Posts: 7,097 ✭✭✭Darragh29


    Draupnir wrote: »
    What language do you want to use in your code behind to access the database? Realistically any ASP.Net project you are working on should reference a separate data access layer project, I would recommend that you write this in C Sharp.

    Is it the fact that you need to have an intermediary layer to access the database that is bothering you? Or the fact that you can't just do it from a page?

    In my opinion, writing to a database from a web page is a terrible idea anyway and creates insecure and poorly designed software.

    Hi folks,

    Many thanks for the advice above, especially the solution provided. I don't mind the fact that there is an intermediary layer required if I want to do this using asp.net. What bother's me is that there is no tutorial for such a simple task on the asp.net website. Every tutorial assumes you are dealing with a database with data already in it and then tells you extremely clearly, how to get the data out, how to sort it, present it, etc, etc, etc, etc. Did nobody think of putting up a tutorial on how to let a site user you migh have, add information through the website???

    One tutorial shows you how to design an excellent webform that uses drop down lists, text boxes and all sort of controls for allowing a user to enter data, but did nobody stop to think about showing you how to handle the data into a database once the submit button is hit???

    I accept that there is a learning curve, I just think that the organisation of the learning material on the asp.net website is very frustrating for someone who is learning this from scratch.


  • Registered Users Posts: 21,257 ✭✭✭✭Eoin


    Try googling for ado.net tutorials as well.

    http://www.visualbuilder.com/aspnet/tutorial/pageorder/22/


  • Advertisement
  • Closed Accounts Posts: 7,097 ✭✭✭Darragh29


    eoin_s wrote: »
    What part exactly is complicated? ASP.Net is not a scripting language (and it's not ASP either, so best not to confuse the two), so of course there's going to be a learning curve. I don't even find it that cumbersome for small applications either.

    I've not used Visual Web developer, but if it's similar to Visual Studio then try something like this.

    Bear in mind that this is not tested and is just off the top of my head. If it does happen to work, then it's far from best practise, but may be enough to get you started.

    The ASPX page:
    [html]
    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="page.aspx.cs" Inherits="page" %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;

    <html xmlns="http://www.w3.org/1999/xhtml&quot; >
    <head runat="server">
    <title>Untitled Page</title>
    </head>
    <body>
    <form id="form1" runat="server">
    <div>
    Dropdown list 1: <asp:DropDownList ID="DropDownList1" runat="server"><asp:ListItem Value="1" Text="1" /></asp:DropDownList><br />
    Dropdown list 2: <asp:DropDownList ID="DropDownList2" runat="server"><asp:ListItem Value="1" Text="1" /></asp:DropDownList><br />
    Dropdown list 3: <asp:DropDownList ID="DropDownList3" runat="server"><asp:ListItem Value="1" Text="1" /></asp:DropDownList><br />
    Dropdown list 4: <asp:DropDownList ID="DropDownList4" runat="server"><asp:ListItem Value="1" Text="1" /></asp:DropDownList><br />
    Dropdown list 5: <asp:DropDownList ID="DropDownList5" runat="server"><asp:ListItem Value="1" Text="1" /></asp:DropDownList><br />
    <p />
    TextBox 1: <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox><br />
    TextBox 2: <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
    <p/>
    <asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" />
    </div>
    </form>
    </body>
    </html>
    [/html]

    The code behind page (C#):
    using System;
    using System.Data;
    using System.Configuration;
    using System.Collections;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;
    using System.Data.SqlClient;
    
    public partial class page : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
    
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            string dropdown1 = DropDownList1.SelectedValue;
            string dropdown2 = DropDownList2.SelectedValue;
            string dropdown3 = DropDownList3.SelectedValue;
            string dropdown4 = DropDownList4.SelectedValue;
            string dropdown5 = DropDownList5.SelectedValue;
    
            string textbox1 = TextBox1.Text;
            string textbox2 = TextBox2.Text;
    
            string sql = "insert into tablename(column1, column2, column3, column4, column5, column6, column7)\n";
            sql += "values(";
            sql += "'" + dropdown1 + "',";
            sql += "'" + dropdown2 + "',";
            sql += "'" + dropdown3 + "',";
            sql += "'" + dropdown4 + "',";
            sql += "'" + dropdown5 + "',";
            sql += "'" + textbox1 + "',";
            sql += "'" + textbox2 + "'";
            sql += ")";        
    
            SqlConnection conn = new SqlConnection("Your Connection String");
            conn.Open();
            SqlCommand cmd = new SqlCommand(sql, conn);        
            cmd.CommandType = CommandType.Text;
            cmd.ExecuteNonQuery();        
            conn.Close();
        }
    }
    

    Just have a question about this solution, I'm assuming I'll have to change the names of the columns in my database for this to work or can I change the reference to the column in the page.aspx.cs script??? Sorry these sound like very basic questions for folks here, am at the bottom of the mountain on this, I think I should have stuck with PHP!

    Update, I might have answered my own question here, I can see the c# script referring to the table name and field names, etc.

    Ok, so when I can see this working, this is just to demo it, I should use a Business Acess Layer to do this from now on, is that it???


  • Registered Users Posts: 21,257 ✭✭✭✭Eoin


    Darragh29 wrote: »
    Just have a question about this solution, I'm assuming I'll have to change the names of the columns in my database for this to work or can I change the reference to the column in the page.aspx.cs script??? Sorry these sound like very basic questions for folks here, am at the bottom of the mountain on this, I think I should have stuck with PHP!

    I can't see how you wouldn't have the same questions if you did this in PHP?
    Darragh29 wrote: »
    Ok, so when I can see this working, this is just to demo it, I should use a Business Acess Layer to do this from now on, is that it???

    Yeah, you would create a class with properties and methods and call it from the page.


  • Closed Accounts Posts: 7,097 ✭✭✭Darragh29


    eoin_s wrote: »
    I can't see how you wouldn't have the same questions if you did this in PHP?



    Yeah, you would create a class with properties and methods and call it from the page.

    Is that what a Business Access layer actually is, a class with properties and methods???

    All that seems to be wrong with the solution provided above is a connection problem to the database...


  • Registered Users Posts: 21,257 ✭✭✭✭Eoin


    You'll need to make sure the connection string works. Check out www.connectionstrings.com

    A business access layer is a lot more than that - check out this page: http://en.wikipedia.org/wiki/Multitier_architecture

    For instance, you have your presentation tier which is your HTML pages. Then you have a business logic tier which does all the logical processing. Then you have the data tier which has all your stored procedures and data etc.


  • Closed Accounts Posts: 7,097 ✭✭✭Darragh29


    SqlConnection conn = new SqlConnection("Your Connection String");
    conn.Open();
    SqlCommand cmd = new SqlCommand(sql, conn);
    cmd.CommandType = CommandType.Text;
    cmd.ExecuteNonQuery();
    conn.Close();


    What would typically go in here, where I've highlighted "Your Connection String" above??? I've put in:

    SqlConnection conn = new SqlConnection("Data Source=mssql2005express.myhostingcompany.ie\manager; Initial Catalog=mydatabase; User ID=myname;");
    conn.Open();
    SqlCommand cmd = new SqlCommand(sql, conn);
    cmd.CommandType = CommandType.Text;
    cmd.ExecuteNonQuery();
    conn.Close();

    But I'm getting an error still...


  • Registered Users Posts: 21,257 ✭✭✭✭Eoin


    try removing the \manager from the data source.


  • Closed Accounts Posts: 7,097 ✭✭✭Darragh29


    This just aint working out for me...

    SqlConnection conn = new SqlConnection("Data Source=http:\\mssql2005express.webhost.ie\helm;Initial Catalog=vehicles;Persist Security Info=True;User ID=gwbush;Password=langer");
    conn.Open();
    SqlCommand cmd = new SqlCommand(sql, conn);
    cmd.CommandType = CommandType.Text;
    cmd.ExecuteNonQuery();
    conn.Close();

    The line above:

    ("Data Source=http:\\mssql2005express.webhost.ie\helm;....

    Seems to be the problem, in particular the \helm piece of the code. I've also tried:

    ("Data Source=mssql2005express.webhost.ie\helm;....

    and also

    ("Data Source=http:\\mssql2005express.webhost.ie;....

    No matter what I do, once I put in the \ before helm or any text, it doesn't have to be the word helm, a little jagged red line appears under the \ and when I hover under it with the mouse, a box appears saying, "unrecognised escape sequence"

    When I log into my hosting control panel and go into databases, it says that the server connection information for this database is:

    mssql2005express.webhost.ie\helm

    Lost! Just wondering has anyone seen this before??? I know I'm a long way off a minimum degree of skill here but I know if I can get info in and back out of my db, then I can start quickly learning the right way of doing it by trial and errror...


  • Registered Users Posts: 21,257 ✭✭✭✭Eoin


    To start off with, a backslash is an escape character, so that has to be escaped itself. So, if you want to put "\" in a string, it has to be "\\".

    I doubt you need the http:// before the servername either.

    If you want, PM me the logon credentials and I will give it a go from here - I'm not too keen on guessing the connection string without the details.


  • Closed Accounts Posts: 7,097 ✭✭✭Darragh29


    eoin_s wrote: »
    To start off with, a backslash is an escape character, so that has to be escaped itself. So, if you want to put "\" in a string, it has to be "\\".

    I doubt you need the http:// before the servername either.

    If you want, PM me the logon credentials and I will give it a go from here - I'm not too keen on guessing the connection string without the details.

    I did a bit of googling and tried that \\ but I'll try it again without the http:\\... Gimme a min...


  • Closed Accounts Posts: 7,097 ✭✭✭Darragh29


    I HAVE IT I HAVE IT IT WORKS I CAN'T BELIEVE IT!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    Thanks a mil for the help Eoin...

    :D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:


  • Advertisement
  • Registered Users Posts: 3,548 ✭✭✭Draupnir


    Darragh, are you honestly saying that you have the knowledge to do all this in PHP but you struggle to solve simple errors and problems such as the ones you have outlined because the language is different?


  • Registered Users Posts: 597 ✭✭✭yeraulone


    Draupnir wrote: »
    Darragh, are you honestly saying that you have the knowledge to do all this in PHP but you struggle to solve simple errors and problems such as the ones you have outlined because the language is different?

    Sure he's only starting .net. I made the same transition from PHP to .net, and I can remember getting stuck on a lot less.


  • Registered Users Posts: 3,548 ✭✭✭Draupnir


    I don't mean to have a go at the guy or anyone making the transition for that matter, its just some of these problems seem to be so trivial that it is hard to believe that they could confuse someone with the necessary programming ability to do this in PHP.

    Maybe my own knowledge of PHP is so limited that I am not aware just how simple these things are in PHP.


  • Closed Accounts Posts: 52 ✭✭zardette


    Draupnir wrote: »
    Darragh, are you honestly saying that you have the knowledge to do all this in PHP but you struggle to solve simple errors and problems such as the ones you have outlined because the language is different?

    again I would have to agree .... maybe before trying to pull your hair at c# asp.net ... develop your PHP skills ...learning to write Spaghetti code is not the right way (as I have learned :mad:)
    Learn how to write scalable, maintainable, and reusable code as early as possible is very important in any language !

    oh btw well done on getting it to work!


  • Closed Accounts Posts: 7,097 ✭✭✭Darragh29


    I can see the points above, unfortunately I have to be able to "see" something working on a very small scale to actually begin understanding the system.

    I can't understand now the asp.net/learn site area leads you in very gently with the basics and then drops you off in the middle of nowhere. I'd find it much better if you were given a small demo on all the basics, as in getting data in, reading data out, etc. When you start seeing results, its very easy to want to learn more. As a student of this stuff, it gets a bit frustrating when you are approaching it exclusively to learn a sellable skill, and you spend hours on tutorials and you still don't know how to post someones name and address into a database! I find if I'm not seeing results, even very small one's, after every tutorial, I tend to want to throw the towel in fairly quickly, but this is more a lack of patience on my part than anything else...


  • Registered Users Posts: 3,548 ✭✭✭Draupnir


    I think you are missing the fundamental point Darragh, you were using ASP.Net tutorials. ASP.Net is never meant to access a database directly, and so there will be no ASP.Net tutorial that teaches you how to access a database. There may well be some that show you how to parse DataSets/DataTables etc. and display their contents on screen though.

    For Data Access, as I think someone recommend above, you need to get C Sharp Tutorials, more specifically ADO.Net tutorials.

    What you need to do, is ask yourself a question, do you want to develop ASP.Net front end layers or .Net Web Applications in their entirety. If the answer is B, then you will have to build knowledge and abilities way beyond those covered in scripting languages.


  • Moderators, Science, Health & Environment Moderators Posts: 8,956 Mod ✭✭✭✭mewso


    Nothing wrong with learning the basics of data access before moving on to either develop your own business objects and data access layer or using something like Linq or nHibernate. If I was giving an example no matter how simple though I would always show the use of parameters. I don't care how simple you want to make it for someone don't show them a method that is considered a high security risk.


  • Closed Accounts Posts: 7,097 ✭✭✭Darragh29


    Draupnir wrote: »
    I think you are missing the fundamental point Darragh, you were using ASP.Net tutorials. ASP.Net is never meant to access a database directly, and so there will be no ASP.Net tutorial that teaches you how to access a database. There may well be some that show you how to parse DataSets/DataTables etc. and display their contents on screen though.

    For Data Access, as I think someone recommend above, you need to get C Sharp Tutorials, more specifically ADO.Net tutorials.

    What you need to do, is ask yourself a question, do you want to develop ASP.Net front end layers or .Net Web Applications in their entirety. If the answer is B, then you will have to build knowledge and abilities way beyond those covered in scripting languages.

    I'm probably wrong here, but I decided to learn asp.net because I thought it was about building dynamic website applications. I see now that its really just about the front of the shop, where it goes after that is another matter altogether!

    I want to be able to sit down with a client and say, "I can design your website and also give you database functionality".

    For example, I'm currently working on a website where the client wants a new website, no problem. His business activity is selling and installing equipment and also servicing and maintaining that equipment based on the servicing and maintenance requirements both being non-scheduled, meaning they can come in at any time as equipment breaks down or someone decides that its time for it to be serviced.

    He wants his customers to be able to go onto his website and login and create a ticket where he can view it, assign a technician, response time and date to that ticket and change the status of the ticket from open to closed, etc. This same guy also wants a project management facility on his website for his installation work, so he can price it, agree installation dates, assign installation technicians, etc.

    I also have a guy who has a property management company who wants residents to be able to do the same thing, instead of ringing up and spending half an hour complaining, he wants the problem to come in through the website and assign resolution data to the transaction.

    I've about 10 folks who want me to do a website and also provide this type of functionality for them, so that's my brief, I've to learn how to do this. I'm finding from business contacts I have that as they find their sales are down, they are opening up to solutions that they had never previously thought of, like a website, etc. I know people will say I'm not nearly there and I'll have to hire someone else, etc, etc.

    I'm not taking on anyone to do this, I just got rid of a business where I had huge overheads and I'm very happy now with clients who want work done, and no overheads like salaries to worry about, just whatever I make is whatever I make, and I don't have to worry about crazy celebrity Paris Hilton like wage bills and other overheads at the same time.

    Going for me, I've designed my own websites before with the above functionality using PHP, (I'm pretty fluent in HTML and CSS and can manage PHP ok), and they seemed to work fine for me. What I'm trying to do here is simply upskill without taking a year to do it and equip myself with a set of sellable skills as soon as I can. I'm not panicking on this, I've a few bob put away to see me over the learning curve, and the clients I have are in no hurry to have these solutions designed for them as they are business contacts I have and are in no hurry at all, there's no problem on that front, but I want to get off the ground soon enough though because it is a business that is based on referral work and contacts, so the sooner I get one guy sorted, the sooner I'll start getting referral work...

    I'm lucky that I have the contacts from previous business dealings, I just need to be able to develop in c# I think...


  • Registered Users Posts: 3,548 ✭✭✭Draupnir


    The good news for you is that you can develop a strong Data Access Layer in C Sharp which you can reuse across all your projects, so once you learn to do this once, you can plug that layer into all your websites.

    If you do it well of course and approach it from a multi tiered architecture point of view.

    Of course, you could make all those projects work with single layer applications and they would be fine. However, you would be doing Number of Projects * Data Access Layer amount more work than you need to and you would be exposing yourself to poor design and security risks galore.

    It's not even that steep a learning curve, 2/3 days of doing online ADO.net and C Sharp tutorials will teach you all you need to know to write a nice reusable data access layer assembly.


  • Advertisement
  • Moderators, Science, Health & Environment Moderators Posts: 8,956 Mod ✭✭✭✭mewso


    If you are doing projects like these and only have a limited time to do it I think you need to have a very close look at Linq or a third party ORM like nhibernate.

    Sadly the ability to write bad applications in asp.net is there with all the drag and drop wizardry allowing for some very lazy development. Using the likes of Linq will ensure that at the very least your business layer is stable, scaleable etc. as long as the db design is solid.

    I won't even go into how much I hate asp.net ajax but I'd be pretty sure you'll be asked for some web 2 functionality along the way and tragically you'll probably end up using the built in solutions in asp.net.


Advertisement