Home All Groups Group Topic Archive Search About

dll & Web Service in VB.Net 2005 Stored Procedure

Author
9 Jun 2006 6:36 AM
James Wong
Hi,

I am writing a vb.net2005 program that needs to create a stored procedure
with SqlServerProject Template.
Now, I have two questions for this stored procedure.

1) How can I import and execute the .dll in this Stored Procedures?
2) How can I connect the Web Service and get the result in this Stored
Procedures?

-------------------------------------------------------------------
Partial Public Class StoredProcedures1
    <Microsoft.SqlServer.Server.SqlProcedure()> _
    Public Shared Sub GetTable()

        Dim strSQL As String = "SELECT * FROM Table1"

        Using conn As New SqlConnection("context connection=true")
            Using cmd As New SqlCommand
                With cmd
                    .Connection = conn
                    .CommandText = strSQL
                    .CommandType = CommandType.Text
                    conn.Open()
                    SqlContext.Pipe.ExecuteAndSend(cmd)
                    .Connection.Close()
                End With
            End Using
        End Using
    End Sub
End Class
-------------------------------------------------------------------

Thanks!

Author
9 Jun 2006 8:16 AM
Cor Ligthert [MVP]
James,

It can be that I understand you wrong, however a stored procedure can
contain SQL transact language. Not VBNet DLL's.

Cor

Show quoteHide quote
"James Wong" <cphk_msdn@nospam.nospam> schreef in bericht
news:%23gd%23I%234iGHA.1204@TK2MSFTNGP02.phx.gbl...
> Hi,
>
> I am writing a vb.net2005 program that needs to create a stored procedure
> with SqlServerProject Template.
> Now, I have two questions for this stored procedure.
>
> 1) How can I import and execute the .dll in this Stored Procedures?
> 2) How can I connect the Web Service and get the result in this Stored
> Procedures?
>
> -------------------------------------------------------------------
> Partial Public Class StoredProcedures1
>    <Microsoft.SqlServer.Server.SqlProcedure()> _
>    Public Shared Sub GetTable()
>
>        Dim strSQL As String = "SELECT * FROM Table1"
>
>        Using conn As New SqlConnection("context connection=true")
>            Using cmd As New SqlCommand
>                With cmd
>                    .Connection = conn
>                    .CommandText = strSQL
>                    .CommandType = CommandType.Text
>                    conn.Open()
>                    SqlContext.Pipe.ExecuteAndSend(cmd)
>                    .Connection.Close()
>                End With
>            End Using
>        End Using
>    End Sub
> End Class
> -------------------------------------------------------------------
>
> Thanks!
>
Author
9 Jun 2006 8:27 AM
James Wong
Thanks!

Show quoteHide quote
"Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> ¼¶¼g©ó¶l¥ó·s»D:O4ff2y5iGHA.4***@TK2MSFTNGP05.phx.gbl...
> James,
>
> It can be that I understand you wrong, however a stored procedure can
> contain SQL transact language. Not VBNet DLL's.
>
> Cor
>
> "James Wong" <cphk_msdn@nospam.nospam> schreef in bericht
> news:%23gd%23I%234iGHA.1204@TK2MSFTNGP02.phx.gbl...
>> Hi,
>>
>> I am writing a vb.net2005 program that needs to create a stored procedure
>> with SqlServerProject Template.
>> Now, I have two questions for this stored procedure.
>>
>> 1) How can I import and execute the .dll in this Stored Procedures?
>> 2) How can I connect the Web Service and get the result in this Stored
>> Procedures?
>>
>> -------------------------------------------------------------------
>> Partial Public Class StoredProcedures1
>>    <Microsoft.SqlServer.Server.SqlProcedure()> _
>>    Public Shared Sub GetTable()
>>
>>        Dim strSQL As String = "SELECT * FROM Table1"
>>
>>        Using conn As New SqlConnection("context connection=true")
>>            Using cmd As New SqlCommand
>>                With cmd
>>                    .Connection = conn
>>                    .CommandText = strSQL
>>                    .CommandType = CommandType.Text
>>                    conn.Open()
>>                    SqlContext.Pipe.ExecuteAndSend(cmd)
>>                    .Connection.Close()
>>                End With
>>            End Using
>>        End Using
>>    End Sub
>> End Class
>> -------------------------------------------------------------------
>>
>> Thanks!
>>
>
>
Author
9 Jun 2006 9:47 AM
Steven Cheng[MSFT]
Hello James,

As for this issue, I've found your another dupilcated thread in the

microsoft.public.dotnet.general

newsgroup. I've posted my response and some suggestion there. I'd
appreciate if you have a look there. Also, if there is anything unclear or
if you need any further assistance, please feel free to post there.

Thanks for your understanding.

Regards,

Steven Cheng
Microsoft Online Community Support


==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================


This posting is provided "AS IS" with no warranties, and confers no rights.



Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)