By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,810 Members | 818 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,810 IT Pros & Developers. It's quick & easy.

StoredProcedures

P: n/a
Anyone have an example with stored procedure with Microsoft SQL
server? I need an example with argument and return value.
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Nov 20 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
* di*****@hotmail-dot-com.no-spam.invalid (dipper) scripsit:
Anyone have an example with stored procedure with Microsoft SQL
server? I need an example with argument and return value.


ADO.NET group:

<news://msnews.microsoft.com/microsoft.public.dotnet.framework.adonet>

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #2

P: n/a
Hello Dipper
Me.SqlCommand1.CommandType = CommandType.StoredProcedure
Me.SqlCommand1.CommandText = "GravaAcessos"
Me.SqlCommand1.Parameters.Clear()
With Me.SqlCommand1.Parameters
.Add("@id", SqlDbType.Int).Value = Me.TextBox2.Text
.Add("@form", SqlDbType.VarChar).Value =
Me.ComboBox2.Text
.Add("@nome", SqlDbType.VarChar).Value = "apagar"
.Add("@controlo", SqlDbType.VarChar).Value = ""
End With
Me.SqlCommand1.ExecuteNonQuery()

If you need to get a return value from the stored
procedure then use .ExecuteReader() instead

Kind Regards
Jorge Cavalheiro
-----Original Message-----
Anyone have an example with stored procedure with Microsoft SQLserver? I need an example with argument and return value.
Posted Via Usenet.com Premium Usenet Newsgroup Services
--------------------------------------------------------- - ** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
--------------------------------------------------------- - http://www.usenet.com
.

Nov 20 '05 #3

P: n/a
Cor
Hi Herfried,

Do we start again
ADO.NET group:
<news://msnews.microsoft.com/microsoft.public.dotnet.framework.adonet>


At the same moment the poster did post it almost.

Without a nice sentence with it.

I know, it was an accident.

:-)

Cor
Nov 20 '05 #4

P: n/a
* "Cor" <no*@non.com> scripsit:
Without a nice sentence with it.


LOL

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #5

P: n/a
I recommend that you look on the got dot net website and download the SQL
Server Application Block. Application Blocks are AWESOME and very easy to
use. This way you don't have to worry about creating connection objects and
all that other jazz..
"dipper" <di*****@hotmail-dot-com.no-spam.invalid> wrote in message
news:40**********@Usenet.com...
Anyone have an example with stored procedure with Microsoft SQL
server? I need an example with argument and return value.
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com

Nov 20 '05 #6

P: n/a
I have tried the way Jorge described but I get an error saying:

"invalid charactervalue for targettype"

Any idea?
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Nov 20 '05 #7

P: n/a
"dipper" <di*****@hotmail-dot-com.no-spam.invalid> schrieb
I have tried the way Jorge described but I get an error saying:

"invalid charactervalue for targettype"

Any idea?


Does

.Add("@id", SqlDbType.Int).Value = CInt(Me.TextBox2.Text)

help?
--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.