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

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

User-defined breakpoints

Posted By:      Posted Date: April 10, 2011    Points: 0   Category :WPF

I've got a problem with VS2010 compiler generating IL 'Break' OpCodes when there are no breakpoints in the solution.

Using the Reflection.Emit functionality, I have implemented a factory that generates a class with a default implementation to a provided interface. The factory takes an interface type and generates a class with methods according to the provided interface. The problem is that IL 'Break' OpCodes starts to appear in some of the the generated methods (for now, they only appear in methods that takes two parameters). This causes VS to halt the execution until I press F10, which makes it extra hard to debug the time-critical part of the code.

When I was debugging the code earlier, I placed a breakpoint inside a anonymous delegate that called one of the methods in the generated class. I have now removed all breakpoints (no breakpoints are shown in the VS Breakpoint panel), but still Visual Studio halts the execution when a method that takes two parameters in the generated class is called.

Since I'm sure I'm not using the 'Break' OpCode anywhere in the code (and I'm not using System.Diagnostics.Debugger.Break anywhere either), my guess is that Visual Studio generates it while compiling based on some stored information about breakpoints?! I have deleted the solution options file (.suo), all PDB f

View Complete Post

More Related Resource Links

User Defined Functions in Microsoft SQL Server

User Defined Functions are compact pieces of Transact SQL code, which can accept parameters, and return either a value, or a table. They are saved as individual work units, and are created using standard SQL commands. Data transformation and reference value retrieval are common uses for functions. LEFT, the built in function for getting the left part of a string, and GETDATE, used for obtaining the current date and time, are two examples of function use. User Defined Functions enable the developer or DBA to create functions of their own, and save them inside SQL Server.

"Type ASP.x is not defined" error for dynamic user control when publishing updateable


I have a user control (ContainerCtrl) which programmatically instantiates another user control (SimpleCtrl) in OnLoad. It builds and runs fine, but when I publish it I get the error "error BC30002: Type 'ASP.SimpleCtrl' is not defined." (If I publish without the "updateable" option there's no error, but I need the site to be updateable.)

I assume this has to do with the particulars of how the assembly(ies) are built for the different compiler options. My question is, how can I get it to work properly for "updateable" publishing?

VS 2008 / .NET 3.5 sp1

The code follows (web.config is the default from Visual Studio).

Many thanks, Dave


<%@ Control Language="VB" ClassName="SimpleCtrl" CodeFile="SimpleCtrl.ascx.vb" Inherits="_SimpleCtrl" %>

    Simple control


Partial Class _SimpleCtrl
    Inherits UserControl

    'Nothing to see here.

End Class


<%@ Control Language="VB" CodeFile="ContainerCtrl.ascx.vb" Inherits="_ContainerCtrl"

Creating a table-valued function on a user defined type in SQL Server CLR

We would like to be able to create a table-valued function on a user defined type.  We would like the syntax in SQL to look like it works for the XML nodes function:   DECLARE @myXml XML = '<a><b>1</b><b>2</b><b>3</b></a>' ; SELECT  node.query('text()') FROM    @myXml.nodes('a/b') nodes (node) ;   In other words, in the FROM clause, we can access the "nodes" method of the xml variable and it returns a rowset. Thanks!

User Defined Data Type - using SMO *** NEED HELP ! ***

Hi,Is it possible to script out the User Defined Data Types via SMO in .NET and specifically VB.Net?  I have not been able to find some examples on how to do this.  If you have some experience with this, pleasepost some examples or provide links where I can find this information.Thank you in advance.-Sydney

how to include a user defined table type as input for stored procedure

Hi ,  I have a user defined table type which i need to pass as input parameter to the stored procedure .How can i do that?

Auto Increment User defined Id

Hi can anyone give me an idea how to create an auto generated id like ED01,ED02 etc., so that when i am entering data the id should be automatically incremented

Best practice for user defined error messages in SQL Server 2005/2008 --Need help

My requirement is to setup a standard practice for our team in handling DB erros and also  user defined messages. We are handling exceptions using Raiseerror method with in Try and Catch blocks.  For user defined message, we are using Sp_addmessage to add our application specific error/warning messages with error codess>80000.  Ex: 80001 | Company name already exists. please check. Here is the sample code ********************************************************************* CREATE PROCEDURE [dbo].[usp_CompanyProfile_insert]  -- Add the parameters for the stored procedure here  (@company_name VARCHAR(50),  @company_code VARCHAR(3),  @user_id INT  ) AS BEGIN  -- SET NOCOUNT ON added to prevent extra result sets from  -- interfering with SELECT statements.  SET NOCOUNT ON;  BEGIN TRY -- Begin Try Block      -- Validate company name   IF EXISTS (SELECT company_id FROM companyprofile WHERE company_name = @company_name)    RAISERROR(90021, 16, 1)      INSERT INTO companyprofile (company_name,       company_code,       createdby)   VALUES(@company_name,     @company_code,     @user_id)    END TRY  -- End Try Block &

Get inserted ids when inserting from User Defined Table Type

Imagine this procedure:   CREATE PROCEDURE [dbo].[insertActive] ( -- Add the parameters for the stored procedure here @p_data dbo.activeUpdate readonly) AS BEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. insert into dbo.active (name,stateid) select name,stateid from @p_data END How can I get the ids of the rows that have been inserted?  I tried searching the net and the forums but could not find anything. Thanks for any and all help, Gareth.

Defaults and User Defined Types Tabs in SSMS

Hello, Just to make sure I was using all the available tools for the right purpose, I have been going through all the tabs I haven't used in SSMS. I've managed to research what they all mean but two have me a little stumped. These two tabs are: [Database]->Programmability->Defaults Quite hard to search for help on as the word default is used to explain a lot of different things! [Database]->Programmability->Types->User-Defined Types I understand what "User-Defined Table Types" and "User-Defined Date Types" are, so what goes in "User-Defined Types"? Can anyone explain what these are? Thanks very much

SSIS User Defined Data Type (Alias Data Types) and OLE DB Command validation

Hello everyone, I've been having an issue with trying to run my SSIS package on a server, and it seems to be failing on the OLE DB Command step.  What we have in our SQL 2005 DB, is a User-Defined Data Type (base type char(7)) and the OLE DB Command is supposed to call a proc that passes in a value of this data type. ie:  CREATE PROCEDURE myProcedure ( @passedInFromSSIS MY_DATATYPE ) AS .... In my SSIS package, I have the type defined as DT_STR with a length of 7.  Now, when I run the package locally (via Visual Studio), the process runs with success.  However, once the package is deployed on a server and run from an application (note: it is run under a different user), the process fails on a validation step with a "Invalid Parameter Number" error. Now, if I change the input parameter in my proc to the base type of the user-defined data type, the process works again. Has anybody run into a similar issue or know what may be causing this issue?  I first suspected perhaps I needed to grant permissions on the user-defined data type (since I was able to run it under my security context, but not under the application's), however noticed that there isn't security tied to the types.  Any other thoughts?  Please let me know if you need further explanation.  Thanks!

Calling a user defined function without Schema Prefix

Calling a user defined function without Schema


 Hi ,

I created a LOGIN User U1 and CREATED a database user DU1 and linked him with the Login User and I created a schema say S1 and set S1 as the default schema for DU1 .

I have a stored Procedure  and a userdefined function inside S1 . I logged in as the Login user, I can execute that procedure directly  without any schema prefix  but I cannot call a user defined function F1 directly (without schema prefix) . it throws an exception

"function name is not a recognized built-in function name"

How can i call a UDF directly with out a schema prefix


--Login User Creation
--Database User Creation and assign to default schema
--Giving User Privilege
EXEC sp_addrolemember db_owner,'S11'

SSAS - Besides 2 big user defined hierarchies, plently of small hierarchies


Hi All

I am working on a project where we have to define an Organization Dimension (we defined a standard dimension not parent-child for performance reasons).

The company I am working for is using codeblocks at the lowest level of the hierarchy (combination of business unit, operating unit, etc...).

We created two user-defined hierarchies on that dimension

- One organizing the codeblocks Geographycally (we have attributes like Area, Subarea, CountryGroup, Country)

- One organizing the codeblocks from a Service perspective (ServiceLine, Subserviceline)

The table looks like:

Codeblock, Area, SubArea, CountryGroup, Country, ServiceLine, SubserviceLine, ...

An additional business requirement we have is to define plenty of very small hierarchies besides those two main hierarchies.

One example would be to have a hierarchy that combines values for Country(Switzerland) and Country(Germany). Of course it would be possible to create calculated members in the MDX Script but we have the requirement to be able to drill down from the sum to the individual countries. Since calculated members are not allowed to have children, they are not an option.

We would like to avoid using a parent-child dimension (I know the possibility of using a parent-child with multiple hierarchies).

One ugly option I found is to add dum

Using a User Defined Function in a case statement


I created a function and am trying to access it through a case statement, but I am getting the error:

Cannot find either column "core" or the user-defined function or aggregate "core.f_FiscalYear_Open_Days", or the name is ambiguous.

The case statement is below:

CASE WHEN c.program_id = 5 and CAST(minutes) As float

how to expose a dependecypeoperty of a control hosted inside anther one in a user defined control




I have a user defined control.

It inherit from grid and it has many controls in it and one of it is a textblock


I what to expose the dependecyproperty of the textbox how can I do this



I mean i want to do something like



dim MyControl as mycontrol

mycontrol.fontfamily    wher the fontfamily is actually   mycontrol.innertextblock.fontfamily



Mapping custom UDT's (User Defined Types)


We have custom user defined types on SQL 2008. I would like to map these data types for SSIS when exporting / importing data. I've managed to do this successfully for the built-in types such geometry / geography by editing the MSSQLToSSIS10.XML.

My question would be if this is also possible for a custom UDT's created with a different schema, ie [myschema].[MyUDT]? If I define the mapping, SSIS only looks for the UDT definition without the schema (which works in the mapping file without the schema), but fails on the table creation, since the data type cannot be found.

If I define [myschema].[MyUDT] in the MSSQLToSSIS10.xml file, the mapping cannot be found in SSIS. I'm stuck here with a catch 22.

Any advice / workarounds ?


Passing a user defined type property to WCF contract



i have a class with a user defined type as follow.

[DataContract(Namespace = "a.com")]
  public class Order : IOrderDescription, INotifyPropertyChanged
    public static OrderLimitations OrderLimits { get; set; }
    public OrderLimitations ThisOrderLimits { get; set; }
    public OrderAlgorithmDescription AlgoDescription { get; set; }

 [DataContract(Namespace = "a.com")]
  public class OrderAlgorithmDescription
    public OrderAlgorithmName AlgorithmName { get; set; }
    public DateTime UTCStartTime { get; s
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