Puiu Posted July 14, 2006 Posted July 14, 2006 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 Quote
Administrators PlausiblyDamp Posted July 14, 2006 Administrators Posted July 14, 2006 Remove the blank line between the attribute and the method it applies to. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.