Problem Creating a Data Access Layer

Last post 07-05-2009 1:11 PM by tlanders99. 5 replies.

Sort Posts:

  • Problem Creating a Data Access Layer

    07-02-2009, 12:56 PM
    • Member
      1 point Member
    • tlanders99
    • Member since 06-29-2009, 11:45 AM
    • Posts 24

    I feel frustrated with this topic and desperately want to understand what is going on.  I guess I feel most frustrated because I have read alot of material and still don't understand my error/problem.

    I read this article for Typed DataSets for the DAL:

    http://www.asp.net/learn/data-access/tutorial-01-vb.aspx

    I also watched this video, which I thought was good...

    http://www.asp.net/learn/data-videos/video-392.aspx


    I am using visual studio 2008 with ms sql 2005.... I am trying to create a dataset(Lessons_Data.xsd) like in these tutorials but I keep getting an error.  I have a database setup and am able to connect to it.  Also when I set up a dataset and configure it by right clicking on it....(TableAdapter Configuration Wizard) I can run queries successfully.

    However, after it is created some things don't seem right. 

    1) First, I am not prompted by Visual Studio to put the dataset in the App_Code folder. I have read this is not such a big deal. Not sure.  I actually created a folder, named it App_Code and placed my dataset in it.

    2) Second, on the video he shows the code behind the dataset by right clicking but when I do that I do not get xml like he shows.  All I get is this....if I right click on it and choose view code

    Partial Class Lessons_Data
    End Class

    I can see a schema file in the actual file if I look with windows explorer and can open it that way though.. Not sure if that is the problem..

    3) Finally, and most importantly I get an error.  The error is:

    ____________________________________________________________________________________________________________

    Compilation Error

    Compilation Error

    Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

    Compiler Error Message: BC30269: 'Public Sub New()' has multiple definitions with identical signatures.

    Source Error:

    Line 32:     
    Line 33:     <Global.System.Diagnostics.DebuggerNonUserCodeAttribute()>  _
    Line 34:     Public Sub New()
    Line 35:         MyBase.New
    Line 36:         Me.BeginInit

    Source File: C:\Users\Travis\Documents\Visual Studio 2008\Projects\Learn_The_English_Language_VB\Learn_The_English_Language_VB\App_Code\Lessons_Data.Designer.vb    Line: 34

    ____________________________________________________________________________________________________________

    The error is in this file(Lessons_Data.Designer.vb) as you can see...Not even sure what that is??

    Ahh this error... I have no clue but I know it is the dataset because if I delete it the webapp works fine... incidently does it hurt my project to delete datasets and make new ones again?  I have deleted this and tried it again several times......


    any help would.... gosh.... be so much appreciated...

    Travis

  • Re: Problem Creating a Data Access Layer

    07-02-2009, 1:19 PM
    • Participant
      1,768 point Participant
    • nmreddy83
    • Member since 01-21-2009, 6:00 PM
    • India
    • Posts 315

    this is old logic using this kind of typed data sets and other stuff...


    now you can go for LINQ-SQL or ADO.net Enitity Framework to get advanced futures


    ***Hope this helps you***
    ***Please mark as answer if this helps you. ***

    thank you,
    -nm reddy
  • Re: Problem Creating a Data Access Layer

    07-02-2009, 11:54 PM
    • Member
      1 point Member
    • tlanders99
    • Member since 06-29-2009, 11:45 AM
    • Posts 24

    Really?  I was not aware.. Thanks...

    I am new to .net so I am just trying to figure some things out... I saw this typed data set tutorial and thought it was the way to go... I will look into LINQ-SQL or ADO.net Entity Framework...

    Any reccomendations for a good place to start? (tutorials, etc.)

  • Re: Problem Creating a Data Access Layer

    07-03-2009, 12:00 AM
    • Star
      11,883 point Star
    • malcolms
    • Member since 06-12-2008, 4:38 AM
    • Melbourne, Australia
    • Posts 1,964

    Both LINQ to SQL and Entity Framework are good ORM's.  The benefit of Entity Framework is it will work with more than just SQL Server, whereas LINQ to SQL will only work with SQL Server. 

    Here's some links:

    http://weblogs.asp.net/scottgu/archive/2007/05/19/using-linq-to-sql-part-1.aspx

    http://msdn.microsoft.com/en-us/library/aa697427(VS.80).aspx

    Sincerely,
    Malcolm Sheridan

    Microsoft Certified Solution Developer
    Please remember to click "Mark as Answer" on the post that helps you, and to click "Unmark as
    Answer" if a marked post does not actually answer your question.
  • Re: Problem Creating a Data Access Layer

    07-03-2009, 1:23 AM
    • Participant
      1,768 point Participant
    • nmreddy83
    • Member since 01-21-2009, 6:00 PM
    • India
    • Posts 315

    i see some MS Press books on it..

    those are very good..

    or you can use online resources like MSDN also


    ***Hope this helps you***
    ***Please mark as answer if this helps you. ***

    thank you,
    -nm reddy
  • Re: Problem Creating a Data Access Layer

    07-05-2009, 1:11 PM
    Answer
    • Member
      1 point Member
    • tlanders99
    • Member since 06-29-2009, 11:45 AM
    • Posts 24

    After reading around I guess ADO.NET entity framework is more versatile.. for me right now I really can't tell a difference because I am just programming for my own personal website... but I found it the easiest to do with asp.net thus far... out of three I have tried... I used this online chapter of a book to do it...

    http://www.scribd.com/doc/8771486/Chp2-Getting-Started

    thanks for all those that helped...

Page 1 of 1 (6 items)