.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Post New Web Links

UDAGG specification

Posted By:      Posted Date: April 10, 2011    Points: 0   Category :
Hi everybody,
    VS2010 against SQLServer2008, developing CLR Aggregate function to calculate the MODE, the function is returning this error:
"Line 1 CREATE AGGREGATE failed because type 'CMode' does not conform to UDAGG specification due to field 'CS$<>9__CachedAnonymousMethodDelegate1'."
    the error is produced here:
   int mode = list.GroupBy(n => n).
               OrderByDescending(g => g.Count()).
               Select(g => g.Key).FirstOrDefault();
    this is the complete code:
using System;
using System.Data;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using Microsoft.SqlServer.Server;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
[SqlUserDefinedAggregate(Format.UserDefined , MaxByteSize = 8000)]
public struct CMode : IBinarySerialize
    private List<int> list;

More Related Resource Links

CREATE AGGREGATE failed because type .. does not conform to UDAGG specification due to method 'Init


I am trying to get the CLR user-defined aggregate functions sample working (VB version).

I've saved the sample (from Invoking CLR User-Defined Aggregate Functions ) to a .vb file and compiled it like this:


.0.50727\vbc  /t:library /out: SQLutils.dll Class1.vb
Microsoft (R) Visual Basic Compiler versie 8.0.50727.42
voor Microsoft (R) .NET Framework versie 2.0.50727.42
Copyright (c) Microsoft Corporation. Alle rechten voorbehouden.


The SQLutils.dll file is created without warnings or errors.


I've created the assembly


create assembly sqlutildll from 'D:\SQLdata\dll\SQLutils.dll'


and then the function:



XPS Documents: A First Look at APIs For Creating XML Paper Specification Documents


Windows Vista includes improved document technology called the XML Paper Specification that is designed to provide users with a consistent document appearance regardless of where and how the document is viewed, solving the age-old problem of document portability and display consistency. Here Bob Watson explains.

Bob Watson

MSDN Magazine January 2006

Datetime column with [Computed column specification] formula

i have a datetime field in my SQL Server table i dont want to add weekend dates in this column. For this reason i always have to check the calendar. how can i use [Computed column specification] formula so that i never add weekend dates?

computed column specification - When is it calculated?

on insert , select...?  It's better than Trigger? thanks.  

Is the old windows palette specification different from the ColorPalette one?

If I get a pointer like this: hPal =   User32Dll.GetClipboardData(WinUserH.CF_PALETTE) and after allocating global memory pointed to by lp I: nRetrieved =   GDI32Dll.GetPaletteEntries(hPal, 0, nEntries, lp) Do I have the equivalent of a color palette? That is, are the entries 4-bytes long and arranged argb? Is the old windows palette specification different from the ColorPalette one? Is there more than one palette format that I might find on the clipboard? Thanks in advace for any insight you might pass on?

sql server 2008 -botttom specification

f my database table is like   id  name  sal 5   ankit   233 1    amit   777 6    anuj    666 que:-suppose in an dept entry done as above.... now my boss came and ask me to find a record that has entry last in the database..(no order by) ans:-my output should be (6 anuj 666) it should work just as  suppose i want first entry from the database i use tthe query (select top 1 from table1) 5 ankit 233 just like this only i want to simplify above ...   for last reply u have sent to me thamk you!! fo that!!!  

Help me with this error Format of the initialization string does not conform to specification starti


I am getting this error-- Format of the initialization string does not conform to specification starting at index 0. whenever i want to insert some record into DB using store procedures.

 String cstr = ConfigurationManager.ConnectionStrings["cstr"].ConnectionString;
       SqlConnection con = new SqlConnection("cstr"); 
        cmd = new SqlCommand("insert1", con);
        cmd.CommandType = CommandType.StoredProcedure;  
         cmd.Parameters.Add(new SqlParameter("@empid", SqlDbType.VarChar)).Value = TextBox1.Text;  
         cmd.Parameters.Add(new SqlParameter("@name", SqlDbType.VarChar)).Value = TextBox2.Text;  

and my connection string in web.config

		<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
			<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=, Culture=neutral, PublicKeyToken=31BF3856AD364E35

dynamic hyperlink with port specification


i am trying to insert a dynamic hyperlink with port specification

for example

normally its easy

<a href="../home/orangehrm">HRMS</a>

but if i have to include the port specification (port 3002) as below

<a href=":3002/home/orangehrm">HRMS</a>

this isnt working so isnt the right format

please help

how to create deleted row again .when i used with (identity specification) in sql server?



i have a table with 2 columns !

1- id int  identity(1,1) not null .

2 - name nvarchar(50)

and data is :

id = 1 , name = "brad pitt"

id = 3, name = "diego maradona"

how i can insert a row with id = 2 ?

How to change Identity Specification


I am trying to change the Identity Specification from no to yes.  I know that I need to go the tab below it and change it, but I am not able to change either of them.  Could someone please assist me with this.

Thank you


Format of the initialization string does not conform to specification starting at index 0.



I am getting the error above when i click on a button...



RDL Report Design Specification Template


Hi all,
Don't think this is suitable to post the question here but I found no where to put it.
May i know where can I get the sample template for report functional design specification?

The design specification must be helpful in requirement gathering and make sure the report developed correctly.

It should include:
1. input filters
2. dataset and its search condition
3. report layout - title, table / matrix, chart
4. what to include in header / footer

Computed Column Specification


I have a computed column specified for a division, how can i avoid having the 0 division error? Is there a way to create an if statement so if the divisor of my formula is 0 I want the value to be 0...

Thanks for your help

Specification of Latin1_General_CS_AS Collator in MsSQL


Is there any specification of Latin1_General_CS_AS. I need to implement this specification to my application. 

After a long search over web, i found http://www.collation-charts.org/mssql/mssql.0409.1252.Latin1_General_CS_AS.html page. But this also doesn't tell how to use it..

Is any one has idea regrading this.

Regards, Parmendr Tyagi
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend