Newbie having problem with DAL and TableAdapters

Last post 10-05-2006 10:59 AM by marlun78. 2 replies.

Sort Posts:

  • Newbie having problem with DAL and TableAdapters

    10-05-2006, 5:52 AM
    • Loading...
    • marlun78
    • Joined on 12-16-2005, 9:01 AM
    • Malmö, Sweden
    • Posts 10

    Hi,

    I've just read the article about Data Access (http://www.asp.net/learn/dataaccess/default.aspx?tabid=63). Now I'm trying to create a DAL my self. But I get lots of errors (18 of them).
    Error examples:

    --------------------------------

    Error 1 'string' does not contain a definition for 'Convert' c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\folder\462f30a9\7f7f39b4\App_Code.mxcujrb-.2.cs 8362 

    [System.Diagnostics.
    DebuggerNonUserCodeAttribute()]
    public void SetIPNull() {
        this[this.tableVisitors.IPColumn] = System.Convert.DBNull; <-- Line 8362
    }

    --------------------------------

    Error 5 'string' does not contain a definition for 'DBNull' c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\folder\462f30a9\7f7f39b4\App_Code.mxcujrb-.2.cs 13882 

    if
    ((IP == null)) {
       
    this.Adapter.InsertCommand.Parameters[1].Value = System.DBNull.Value; <-- Line 13882
    }
    else {
        this.Adapter.InsertCommand.Parameters[1].Value = ((string)(IP));
    }

    --------------------------------

    Error 9 'string' does not contain a definition for 'Data' c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\folder\462f30a9\7f7f39b4\App_Code.mxcujrb-.2.cs 13907 

    this.Adapter.InsertCommand.Parameters[5].Value = ((System.DateTime)(CreatedDate));
    System.Data.ConnectionState previousConnectionState =
    this.Adapter.InsertCommand.Connection.State;
    if (((this.Adapter.InsertCommand.Connection.State & System.Data.ConnectionState.Open) != System.Data.ConnectionState.Open)) { <-- Line 13907
        this.Adapter.InsertCommand.Connection.Open();
    }


    --------------------------------

    Thanks!
    // Martin

    // Martin
  • Re: Newbie having problem with DAL and TableAdapters

    10-05-2006, 10:14 AM
    • Loading...
    • Javier Luna
    • Joined on 08-29-2006, 4:34 PM
    • Lima, Peru
    • Posts 592

    Hi marlun,

    You would have to look this thread http://forums.asp.net/thread/1387815.aspx

    Good Coding!

    Javier Luna
    http://guydotnetxmlwebservices.blogspot.com/

     

    from Villa El Salvador for world!
  • Re: Newbie having problem with DAL and TableAdapters

    10-05-2006, 10:59 AM
    Answer
    • Loading...
    • marlun78
    • Joined on 12-16-2005, 9:01 AM
    • Malmö, Sweden
    • Posts 10
    HAHA... I got the errors because I had columns in my database called 'System' and 'Browser'.
    // Martin
Page 1 of 1 (3 items)
Microsoft Communities
Page view counter