Jasinski Technical Wiki

Navigation

Home Page
Index
All Pages

Quick Search
»
Advanced Search »

Contributor Links

Create a new Page
Administration
File Management
Login/Logout
Your Profile

Other Wiki Sections

Software

PoweredBy

SqlCommand and SqlConnection Objects

RSS
Modified on Mon, Oct 22, 2012, 11:46 AM by Administrator Categorized as Uncategorized

For a Stored Procedure

conn.Open()

Dim cmd As New SqlCommand() 
cmd.CommandTimeout = 180
cmd.CommandType = CommandType.StoredProcedure
cmd.Connection = conn
cmd.CommandText = "dbo.usp_MyStoredProcedure"
cmd.Parameters.AddWithValue("@param1", comm)

Dim da as SqlDataAdapter = new SqlDataAdapter(cmd)
Dim dt As DataTable = New DataTable()
da.Fill(dt)

conn.Close()

ScrewTurn Wiki version 3.0.1.400. Some of the icons created by FamFamFam. Except where noted, all contents Copyright © 1999-2024, Patrick Jasinski.