|
-
Feb 14th, 2013, 04:35 PM
#1
Thread Starter
New Member
Executing a Stored Procedure in VB.net
Hi,
I have written a piece of code to execute a stored procedure, however it isn't working, it is coming up with no errors and appears to be connecting to the database fine
Imports System.Data.SqlClient
Public Class Form1
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
Dim sqlConnection1 As New SqlConnection("Data Source=XXXX;InitialCatalog=xxx;IntegratedSecurity = True")
Dim cmd As New SqlCommand
Dim reader As SqlDataReader
cmd.CommandText = "name"
cmd.CommandType = CommandType.StoredProcedure
cmd.Connection = sqlConnection1
sqlConnection1.Open()
reader = cmd.ExecuteReader()
sqlConnection1.Close()
End Sub
End Class
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|