System.Windows.Form.RichTextbox in a Sql Database project?

  • OK I felt like trying to make a CLR project that does RTF to Text conversion.

    Everyone says it's so simple, and yet I'm stuck on the most trivial of issues.

    If I create a New Visual Basic >> Windows Application Project in Visual Studio 2005, I can use this command to create an object no problem:

    dim rtfObj as New System.Windows.Form.RichTextbox

    If I create a New Visual Basic >>Database >>SQL Server Project , the same command does not let me reference System.Windows, let alone any sub classes:

    This is really basic stuff... how can i use a windows.form object, if I cant reference it? the Intellesense fails the moment i try Imports System.W*, so I can't provide a reference.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • You cannot use UI components from w/in the SQL CLR.

    The CLR uses host protection attributes (HPAs) which declare information about what specific framework classes and methods do. This allows the host (in this case SQL Server) to disallow these from running. The reason for this is because allowing these components to load and run would severely impact SQL Server, blocking threads and making it inaccessable.

  • The process of converting data to the RTF format is basically a data transformation routine.

    Even though it can be conceived as a back-end type of process, it might not be a very good architectural choice to put it on a SQL Server.

    If the original data turns out to be a large set of data to transform to RTF, you might end up punishing the performance and scalability of your (DB) Server for placing the process as a SQL Server process.

    A better choice might be to put it in some other software layer.

    If the point is that you have the data in SQL Server and you need a SQL Server process to be the starting point (of the entire process), no problem.

    You can design a web service, in ASP.NET, that does the actual transformation (use XLST transforms for the RTF conversion) to RTF, and you can have SQL Server 2005 invoke that web service.

    It might be a good idea to have a weak coupling between the starting point process and the web service call, in which case, you may explore the use of a Service Broker service as a dispatcher of transformation processes.

    Best regards, Gastón

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply