CodeSmith Community
Your Code. Your Way. Faster!

PLINQo Support

Latest post 05-19-2008 10:00 AM by lrr81765. 2 replies.
  • 05-15-2008 2:32 PM

    • lrr81765
    • Not Ranked
    • Joined on 03-21-2005
    • Posts 6
    • Points 60

    PLINQo Support

    Is this the proper place for PLINQO support? I am havingan issue with the DBML template. all of the insert statements have  a blank column name

       <ElementType Id="InsertCarrierLocality1" Name="InsertCarrierLocalityResult">
          <Column Name="" Member="" Type="System.Decimal" DbType="decimal(38,0)" CanBeNull="true" />
        </ElementType>

    and this is causing problems..

    Larry

    • Post Points: 35
  • 05-15-2008 4:35 PM In reply to

    • pwelter34
    • Top 25 Contributor
    • Joined on 03-13-2003
    • Eden Prairie, MN
    • Posts 255
    • Points 680,955

    Re: PLINQo Support

    If you could provide the sql script for the table that is having the issue, i can help debug.

    thanks,
    ~ Paul

    • Post Points: 35
  • 05-19-2008 10:00 AM In reply to

    • lrr81765
    • Not Ranked
    • Joined on 03-21-2005
    • Posts 6
    • Points 60

    Re: PLINQo Support

    Ok, I have determined that this is in the DBML template, and possibly an issue with the  ParameterSchema object.

    I am using the below table, and have tried several varations of the insertEmployee

    • Return SCOPE_IDENTITY()
    • SET a OUPUT parameter with SCOPE_IDENTITY
    • Create a local parameter, set it to SCOPE_IDENTITY and return.

     All of these yield the below results.

    Any assistance would be greatly appreciated.

     

    Thanks.

    Larry 

     

     USE [test]
    GO
    /****** Object:  Table [dbo].[Emp]    Script Date: 05/19/2008 10:49:44 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    SET ANSI_PADDING ON
    GO
    CREATE TABLE [dbo].[Emp](
        [EmpID] [int] NOT NULL,
        [EmpName] [varchar](30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
        [MgrID] [int] NULL,
    PRIMARY KEY CLUSTERED
    (
        [EmpID] 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
    SET ANSI_PADDING OFF
    GO
    ALTER TABLE [dbo].[Emp]  WITH CHECK ADD FOREIGN KEY([MgrID])
    REFERENCES [dbo].[Emp] ([EmpID])

     Create PROCEDURE [dbo].[insertEmployee]
        -- Add the parameters for the stored procedure here
        @empName varchar(30) = null,
        @mgrId int = 0
    AS
    BEGIN
        -- SET NOCOUNT ON added to prevent extra result sets from
        -- interfering with SELECT statements.
        SET NOCOUNT ON;
            
        -- Insert statements for procedure here
        insert into Emp ( EmpName, MgrId ) values (@empName,@mgrId)
        
    END
    Return SCOPE_IDENTITY

     

     

     

     

     <?xml version="1.0" encoding="utf-16"?>
    <Database Name="test" EntityNamespace="CBDSS.Data" ContextNamespace="CBDSS.Data" Class="TestDataContext" EntityBase="EntityBase" xmlns="http://schemas.microsoft.com/linqtosql/dbml/2007">
      <Connection Mode="AppSettings" ConnectionString="Data Source=.\sqlexpress;Initial Catalog=test;Integrated Security=True" SettingsObjectName="Properties.Settings" SettingsPropertyName="TestConnectionString" Provider="System.Data.SqlClient" />
      <Table Name="dbo.Emp" Member="Emp">
        <Type Name="Emp">
          <Column Name="EmpID" Member="EmpID" Storage="_empID" Type="System.Int32" DbType="int NOT NULL" IsPrimaryKey="true" CanBeNull="false" />
          <Column Name="EmpName" Member="EmpName" Storage="_empName" Type="System.String" DbType="varchar(30)" CanBeNull="true" />
          <Column Name="MgrID" Member="MgrID" Storage="_mgrID" Type="System.Int32" DbType="int" CanBeNull="true" />
          <Association Name="FK__Emp__MgrID__7D78A4E7" Member="MgrEmp" Storage="_mgrEmp" ThisKey="MgrID" OtherKey="EmpID" Type="Emp" IsForeignKey="true" />
          <Association Name="FK__Emp__MgrID__7D78A4E7" Member="MgrEmpList" Storage="_mgrEmpList" ThisKey="EmpID" OtherKey="MgrID" Type="Emp" />
        </Type>
      </Table>
      <Function Name="dbo.insertEmployee" Method="InsertEmployee">
        <Parameter Name="@empName" Parameter="empName" Type="System.String" DbType="varchar(30)" />
        <Parameter Name="@mgrId" Parameter="mgrId" Type="System.Int32" DbType="int" />
        <ElementType Id="InsertEmployee1" Name="InsertEmployeeResult">
          <Column Name="" Member="" Type="System.Decimal" CanBeNull="true" />
        </ElementType>
      </Function>
    </Database>

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