473,698 Members | 1,889 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

dll & Web Service in VB.Net 2005 Stored Procedure

Hi,

I am writing a vb.net2005 program that needs to create a stored procedure
with SqlServerProjec t 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 StoredProcedure s1
<Microsoft.SqlS erver.Server.Sq lProcedure()> _
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.Tex t
conn.Open()
SqlContext.Pipe .ExecuteAndSend (cmd)
.Connection.Clo se()
End With
End Using
End Using
End Sub
End Class
-------------------------------------------------------------------

Thanks!
Jun 9 '06 #1
5 2153
James,

As you use a newsreader as Outlook Express, will you than be so kind not to
multipost to these dotNet newsgroup. We appriciate crossposting (sending one
message to more newsgroups at once)

I have given an answer in another newsgroup where you have placed the
question.

Thanks in advance

Cor

"James Wong" <cp*******@nosp am.nospam> schreef in bericht
news:%2******** **********@TK2M SFTNGP02.phx.gb l...
Hi,

I am writing a vb.net2005 program that needs to create a stored procedure
with SqlServerProjec t 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 StoredProcedure s1
<Microsoft.SqlS erver.Server.Sq lProcedure()> _
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.Tex t
conn.Open()
SqlContext.Pipe .ExecuteAndSend (cmd)
.Connection.Clo se()
End With
End Using
End Using
End Sub
End Class
-------------------------------------------------------------------

Thanks!

Jun 9 '06 #2
Thanks!

"Cor Ligthert [MVP]" <no************ @planet.nl> ¼¶¼g©ó¶l¥ó·s»D: %2************* ***@TK2MSFTNGP0 5.phx.gbl...
James,

As you use a newsreader as Outlook Express, will you than be so kind not
to multipost to these dotNet newsgroup. We appriciate crossposting
(sending one message to more newsgroups at once)

I have given an answer in another newsgroup where you have placed the
question.

Thanks in advance

Cor

"James Wong" <cp*******@nosp am.nospam> schreef in bericht
news:%2******** **********@TK2M SFTNGP02.phx.gb l...
Hi,

I am writing a vb.net2005 program that needs to create a stored procedure
with SqlServerProjec t 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 StoredProcedure s1
<Microsoft.SqlS erver.Server.Sq lProcedure()> _
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.Tex t
conn.Open()
SqlContext.Pipe .ExecuteAndSend (cmd)
.Connection.Clo se()
End With
End Using
End Using
End Sub
End Class
-------------------------------------------------------------------

Thanks!


Jun 9 '06 #3
Hello James,

Is the stoerd procedure you mentioned here means the new CLR stored
procedure in SQL Server 2005? If so, you can use managed code in CLR stored
procedure (just a .net class method). And the general steps to create and
install such a CLR SP is :
1. compile our CLR stored procedure as assembly

2. install the assembly into SQL 2005 database (grant suffient access level
and also some other security related setting)

3. create the stored procedure refer to the assembly and class

Here is a good web article demostrate a complete example. The author
created a CLR stored procedure which will access a remote webservice and
use the webservice result in his SP.

#CLR Stored Procedure Calling External Web Service
http://davidhayden.com/blog/dave/arc...4/25/2924.aspx

Also, for general information on SQL 2005 CLR stored procedure, you can
refer to the following BOL document:

#CLR Stored Procedures
http://msdn2.microsoft.com/en-us/library/ms131094.aspx

Hope this helps.

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.)

Jun 9 '06 #4
Steven,

Thanks, so you see you learn every day in these newsgroups.

:-)

Cor

"Steven Cheng[MSFT]" <st*****@online .microsoft.com> schreef in bericht
news:4V******** ******@TK2MSFTN GXA01.phx.gbl.. .
Hello James,

Is the stoerd procedure you mentioned here means the new CLR stored
procedure in SQL Server 2005? If so, you can use managed code in CLR
stored
procedure (just a .net class method). And the general steps to create and
install such a CLR SP is :
1. compile our CLR stored procedure as assembly

2. install the assembly into SQL 2005 database (grant suffient access
level
and also some other security related setting)

3. create the stored procedure refer to the assembly and class

Here is a good web article demostrate a complete example. The author
created a CLR stored procedure which will access a remote webservice and
use the webservice result in his SP.

#CLR Stored Procedure Calling External Web Service
http://davidhayden.com/blog/dave/arc...4/25/2924.aspx

Also, for general information on SQL 2005 CLR stored procedure, you can
refer to the following BOL document:

#CLR Stored Procedures
http://msdn2.microsoft.com/en-us/library/ms131094.aspx

Hope this helps.

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.)

Jun 9 '06 #5
Hello James,

Any further progress on this? If there is still anything we can help,
please feel free to post here.

Regards,

Steven Cheng
Microsoft MSDN Online Support Lead
=============== =============== =============== =====

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.)

Jun 13 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2869
by: antonovaCCCS | last post by:
In our old VB 6 application we utilize a mail merge feature of Word 97 with MS Access. A table in Access is populated from VB and a Word template is wired to that table. So all we do in the code is call the merge method of Word. Problem: We are moving to VB.NET (VS 2005) and Office 2003. I want to bypass Access and either use a connection to SQL or a parametrized stored procedure. I found some samples, but was not able to open the...
2
2455
by: Trevor | last post by:
Argh! This problem is driving me nuts! Can you help? In November of 2003, I installed a web service on Windows Server 2003 built in VB.NET for v1.1.4322 of the framework. It contains a timer (System.Timers.Timer) which has an interval of 24 hours. Actually, it reads a time like 2AM out of the config file, and calculates the time between the start of the service to 2AM, and sets the timer. When the timer expires, it re-reads the...
3
1556
by: James Wong | last post by:
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?
1
2581
by: den 2005 | last post by:
Hi everybody, I created several stored procedure in a local sql server 2005 express database, now when I call/execute them in the asp.net 2.0 web page, it returns an error message of "Cannot find the stored procedure '<proc_name>'", this is funny, when I execute the command in a sql query window "exec sp_GetAllArticles", it also returns cannot find stored procedure, but when I execute the "Use <DBName>" and then execute the statement, it...
6
6393
by: rn5a | last post by:
Suppose a SQL Server 2005 stored procedure looks like this: ALTER PROCEDURE SPName @UserID int SELECT COUNT(*) FROM Table1 WHERE UserID = @UserID SELECT COUNT(*) FROM Table1 In the ASPX page, I can get the result of the first query in the above SP using
4
4359
by: scparker | last post by:
Hello, We have a stored procedure that does a basic insert of values. I am then able to retrieve the ID number created for this new record. We are currently using ASP.NET 2.0 and use N-Tier Architecture. The Stored Procedures are used through TableAdaptors, which in turn are used by Class Files. I wish to be able to return this new ID value using the Stored
0
1139
by: sheenaa | last post by:
Hi Everyone, I m using ASP.NET 2005 with C# and SQL SERVER 2005. I m using stored procedure and sql datasource control to retrieve the data. I want to use the trigger alongwith storedprocedure. I have created the following trigger on emp_table.
12
30933
by: barmatt80 | last post by:
I don't know if this is the right part of the forum. But.... I have been working all night trying to create a web service to call a stored procedure in sql server 2008. The stored procedure calls a linked server to a db2 database that accepts 1 integer and returns 6 variables. The end result would be publish the web service to our sharepoint servers. This is not a problem. I am just trying to wrap my head around it. I know how to call...
3
5047
by: cmrhema | last post by:
Hi, Kindly excuse if I am posting in the wrong place. I am using Visual Studio 2008, .net framework 3.5, asp.net , c# and sql server 2005. I am supposed to pass stored procedures from client to wcf service. The WCF service should execute the stored procedure and return the result.
0
8668
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8597
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9148
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8884
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8855
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7708
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4611
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3034
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2319
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.