CodeSmith Community
Your Code. Your Way. Faster!

.netTiers 2.3.0 Beta 1 templates, 3.5 framework VS 2008 and SQL Server 2008

Latest post 07-03-2008 10:26 AM by drel. 7 replies.
  • 07-02-2008 10:19 AM

    • Don
    • Top 100 Contributor
    • Joined on 11-03-2006
    • Posts 48
    • Points 1,000

    .netTiers 2.3.0 Beta 1 templates, 3.5 framework VS 2008 and SQL Server 2008

    Has anybody else tried using the above combination yet or am I the only one?

    Upgrading from the previous templates to these and switching to 3.5 framework and 4.0 enterprise library has been difficult so far.  I'm curious if others have gone down this path yet?

    • Post Points: 35
  • 07-02-2008 11:55 AM In reply to

    • vbandrade
    • Top 25 Contributor
    • Joined on 09-27-2007
    • Brasil
    • Posts 254
    • Points 6,460

    Re: .netTiers 2.3.0 Beta 1 templates, 3.5 framework VS 2008 and SQL Server 2008

    I´ve never tested against SQL 2008... I cant get a hold on one license of it... );

    What exactly is the error?  Try setting "Execute SQL" to false...

    • Post Points: 35
  • 07-02-2008 12:29 PM In reply to

    • Don
    • Top 100 Contributor
    • Joined on 11-03-2006
    • Posts 48
    • Points 1,000

    Re: .netTiers 2.3.0 Beta 1 templates, 3.5 framework VS 2008 and SQL Server 2008

    This is our problem...

     http://community.codesmithtools.com/forums/t/8624.aspx

    It was posted by a co-worker of mine.

    • Post Points: 35
  • 07-03-2008 6:44 AM In reply to

    • blake05
    • Top 10 Contributor
    • Joined on 04-03-2008
    • Wisconsin
    • Posts 515
    • Points 9,650

    Re: .netTiers 2.3.0 Beta 1 templates, 3.5 framework VS 2008 and SQL Server 2008

    Reply |Contact |Answer

    Hello,

    I have tested .netTiers 2.3 beta 1 on Windows Server 2008 x64 with the SQL Server 2008 sample databases along with my own databases running on SQL Server 08. I set the .netTiers templates to use Visual Studio 2008 and the .Net 3.5 Framework. Could you please check on vbandrade's feedback in reply to your post.

    Thanks

    -Blake Niemyjski 

    Blake Niemyjski

    CodeSmith Tools, LLC. Software Development Engineer

    Blog: http://windowscoding.com/blogs/blake/

    ----------------------------------------------------------------------
     Member of the .NetTiers team | Visit http://www.nettiers.com
    ----------------------------------------------------------------------

    • Post Points: 35
  • 07-03-2008 7:29 AM In reply to

    • Don
    • Top 100 Contributor
    • Joined on 11-03-2006
    • Posts 48
    • Points 1,000

    Re: .netTiers 2.3.0 Beta 1 templates, 3.5 framework VS 2008 and SQL Server 2008

    We did check and we did keep the Execute SQL set to false. There were actually 2 different problems that we were dealing with.  1 was related to problems with the new beta templates accurately executing this custom stored procedure:

     Create Procedure [dbo].[_UserPermission_AddRemoveCSRole]
    (
    @Action int=0, -- 0-Add, 1-Remove
    @AppUserName nvarchar(256),
    @UserRoleName nvarchar(256)
    )
    As

    Declare @AppName nvarchar(256)
    Set @AppName='tcanet'

    Declare @CurrentUtcTime datetime
    Set @CurrentUtcTime = getUtcDate()

    Declare @AppUserID uniqueidentifier
    Declare @UserExistsReturn int
    Declare @UserInRoleReturn int

    Exec @UserExistsReturn = dbo.aspnet_Membership_GetUserByName @ApplicationName=@AppName,
                                                                 @UserName=@AppUserName,
                                                                 @CurrentTimeUtc=@CurrentUtcTime

    Exec @UserInRoleReturn = dbo.aspnet_UsersInRoles_IsUserInRole @ApplicationName=@AppName,
                                                                  @UserName=@AppUserName,
                                                                  @RoleName=@UserRoleName

    If @UserExistsReturn = 0
      If @Action = 0
        If @UserInRoleReturn = 0
          Exec dbo.aspnet_UsersInRoles_AddUsersToRoles @ApplicationName=@AppName,
                                                       @RoleNames=@UserRoleName,
                                                       @UserNames=@AppUserName,
                                                       @CurrentTimeUtc=@CurrentUtcTime
        Else
          Return -2 -- Cannot add - User already added to the role
      Else
        If @UserInRoleReturn = 1
          Exec dbo.aspnet_UsersInRoles_RemoveUsersFromRoles @ApplicationName=@AppName,
                                                            @UserNames=@AppUserName,
                                                            @RoleNames=@UserRoleName
        Else
          Return -3 -- Cannot remove - User is not added to the role
    Else
      Return -1 -- Invalid User

    Return 0
    GO

     

    The other was that no custom stored procedures that returned views would work.  As mentioned in the previous link, they were all missing from the embedded xml file.  I'm curious if you can do a test with your setup to see if you can create a custom stored procedure that returns a view.

    • Post Points: 35
  • 07-03-2008 7:55 AM In reply to

    • blake05
    • Top 10 Contributor
    • Joined on 04-03-2008
    • Wisconsin
    • Posts 515
    • Points 9,650

    Re: .netTiers 2.3.0 Beta 1 templates, 3.5 framework VS 2008 and SQL Server 2008

    Hello,

    Could you please email me (BNiemyjski@codesmithtools.com) your complete schema, As I need tables, views and stored procs to test.

    Thank you

    -Blake Niemyjski

    Blake Niemyjski

    CodeSmith Tools, LLC. Software Development Engineer

    Blog: http://windowscoding.com/blogs/blake/

    ----------------------------------------------------------------------
     Member of the .NetTiers team | Visit http://www.nettiers.com
    ----------------------------------------------------------------------

    • Post Points: 60
  • 07-03-2008 10:19 AM In reply to

    • drel
    • Top 150 Contributor
    • Joined on 12-08-2006
    • Posts 26
    • Points 545

    Re: .netTiers 2.3.0 Beta 1 templates, 3.5 framework VS 2008 and SQL Server 2008

    CREATE TABLE [dbo].[Customer](

    [CustomerId] [int] NOT NULL,

    [FirstName] [varchar](50) NULL,

    [LastName] [varchar](50) NULL,

    CONSTRAINT [PK_Customer] PRIMARY KEY CLUSTERED

    (

    [CustomerId] ASC

    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]

    ) ON [PRIMARY]

    GO

    CREATE VIEW [dbo].[CustomerView]

    AS

    SELECT CustomerId, FirstName + ' ' + LastName AS Name

    FROM dbo.Customer

    GO

    CREATE
    PROCEDURE [dbo].[_Customer_DoSomething]@CustomerId int

    AS

    BEGIN

    -- SET NOCOUNT ON added to prevent extra result sets from

    -- interfering with SELECT statements.

    SET NOCOUNT ON;

    -- Insert statements for procedure here

    Select * from Customer

    Where CustomerId = @CustomerId

    END

    GO

    CREATE
    PROCEDURE [dbo].[_CustomerView_DoSomething]@CustomerId int

    AS

    BEGIN

    -- SET NOCOUNT ON added to prevent extra result sets from

    -- interfering with SELECT statements.

    SET NOCOUNT ON;

    -- Insert statements for procedure here

    Select * from CustomerView

    Where CustomerId = @CustomerId

    END

    GO

    • Post Points: 5
  • 07-03-2008 10:26 AM In reply to

    • drel
    • Top 150 Contributor
    • Joined on 12-08-2006
    • Posts 26
    • Points 545

    Re: .netTiers 2.3.0 Beta 1 templates, 3.5 framework VS 2008 and SQL Server 2008

    Blake, the above schema will reproduce the problem.

    • Post Points: 5
Page 1 of 1 (8 items) | RSS
Copyright © 2008 CodeSmith Tools, LLC
Powered by Community Server (Commercial Edition), by Telligent Systems