StoredProcedures

  • Thread starter Thread starter dipper
  • Start date Start date
D

dipper

Anyone have an example with stored procedure with Microsoft SQL
server? I need an example with argument and return value.
 
* (e-mail address removed)-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:

<
 
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
 
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
 
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 said:
Anyone have an example with stored procedure with Microsoft SQL
server? I need an example with argument and return value.
 
I have tried the way Jorge described but I get an error saying:

"invalid charactervalue for targettype"

Any idea?
 
Back
Top