Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I'm trying to create a dll to use inside SQL Server 2005 and i have a strange problem:

 

Imports System
Imports System.Data
Imports System.Data.Sql
Imports System.Data.SqlClient
Imports Microsoft.SqlServer.Server
Imports System.Data.SqlTypes


Public Class SQLCLR


   <Microsoft.SqlServer.Server.SqlProcedure()> _

   Public Shared Sub MySub(ByVal SomeString As String, ByVal DI As Date)

       Dim cmd As New SqlCommand

       Dim PrimaPrima As String
       Dim j As Integer

       Using connection As New SqlConnection("context connection=true")
           connection.Open()
           cmd.Connection = connection

           While SomeString.Length > 0
               j = SomeString.IndexOf(",")
               PrimaPrima = SomeString.Substring(0, j)
               'de pus update command
               cmd.CommandText = "UPDATE Prime SET" & _
                                  "DI =" & DI.ToString & " where idPrima =" & _
                                   PrimaPrima
               cmd.CommandType = CommandType.Text
               cmd.ExecuteNonQuery()

               SomeString = SomeString.Substring(j + 1, SomeString.Length - j - 1)
           End While
       End Using
   End Sub


End Class

 

 

The problem appears at this line:

 

<Microsoft.SqlServer.Server.SqlProcedure()> _

 

 

It says that

 

Attribute specifier is not a complete statement. Use a line continuation to apply the attribute to the following statement.

 

Any ideeas why? I have nono

thanks

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...