call stored proc c#
C#
using (SqlConnection conn = new SqlConnection("Server=(local);DataBase=Northwind;Integrated Security=SSPI")) {
conn.Open();
// 1. create a command object identifying the stored procedure
SqlCommand cmd = new SqlCommand("CustOrderHist", conn);
// 2. set the command object so it knows to execute a stored procedure
cmd.CommandType = CommandType.StoredProcedure;
// 3. add parameter to command, which will be passed to the stored procedure
cmd.Parameters.Add(new SqlParameter("@CustomerID", custId));
// execute the command
using (SqlDataReader rdr = cmd.ExecuteReader()) {
// iterate through results, printing each to console
while (rdr.Read())
{
Console.WriteLine("Product: {0,-35} Total: {1,2}",rdr["ProductName"],rdr["Total"]);
}
}
}
Also in C#:
- Title
- c sharp list indexer
- Category
- C#
- Title
- unity random float
- Category
- C#
- Title
- asp.net get query string parameter
- Category
- C#
- Title
- c sharp comments
- Category
- C#
- Title
- c# merge two lists as queryable
- Category
- C#
- Title
- c# typeof
- Category
- C#
- Title
- linq c# or
- Category
- C#
- Title
- unity c# is not equal to
- Category
- C#
- Title
- list contains type c#
- Category
- C#
- Title
- c# get foreground window
- Category
- C#
- Title
- unity print to console
- Category
- C#
- Title
- transform object according to its parent unity
- Category
- C#
- Title
- c# reverse array
- Category
- C#
- Title
- get string character by index c#
- Category
- C#
- Title
- c# ?
- Category
- C#
- Title
- c# error "The name 'ViewBag' does not exist in the current context"
- Category
- C#
- Title
- get random value from list c#
- Category
- C#
- Title
- Request.Form
- Category
- C#
- Title
- where keyword in c#
- Category
- C#
- Title
- c# make string null
- Category
- C#
- Title
- c# index in select
- Category
- C#
- Title
- unity up arrow input
- Category
- C#
- Title
- disable a component unity
- Category
- C#
- Title
- unity scene name get
- Category
- C#
- Title
- query associative table ef6
- Category
- C#
- Title
- no entity framework provider found for the ado.net provider with invariant name
- Category
- C#
- Title
- how to sort string array alphabetically in c#
- Category
- C#
- Title
- iteration c#
- Category
- C#
- Title
- how to make a pause feautre in unity
- Category
- C#
- Title
- c# access session in class
- Category
- C#
- Title
- get absolute url c#
- Category
- C#
- Title
- decimal to string whole number c#
- Category
- C#
- Title
- Unity C# instantiate prefab
- Category
- C#
- Title
- asp net mvc 5 return view from another controller
- Category
- C#
- Title
- uwp file open picker
- Category
- C#
- Title
- unity html request
- Category
- C#
- Title
- how to reference a transform unity
- Category
- C#
- Title
- c# check if type implements interface
- Category
- C#
- Title
- how to redirect to extern page in .net core
- Category
- C#
- Title
- c#if
- Category
- C#
- Title
- how to use more than one condition in ef join
- Category
- C#
- Title
- make camera follow character unity 2020
- Category
- C#
- Title
- c# loop through two dimensional array
- Category
- C#
- Title
- response redirect new tab
- Category
- C#
- Title
- unity gizmo draw line
- Category
- C#
- Title
- how to make an object move in unity
- Category
- C#
- Title
- new command - latex
- Category
- C#
- Title
- c# foreach arra
- Category
- C#
- Title
- C# get pc language
- Category
- C#
- Title
- unity onselect gizmos wireframe
- Category
- C#
- Title
- wpf c# select folder path
- Category
- C#
- Title
- how to set progress openedge driver name for odbc connection c#
- Category
- C#
- Title
- c# trim string
- Category
- C#
- Title
- length of a string c#
- Category
- C#
- Title
- c# convert dictionary to anonymous object
- Category
- C#
- Title
- format phone number in c# .net
- Category
- C#
- Title
- What is a class in c#
- Category
- C#
- Title
- exception handling c# stack overflow
- Category
- C#
- Title
- c# close window
- Category
- C#
- Title
- how to turn 3 floats into quartenion
- Category
- C#
- Title
- xamarin forms alarm
- Category
- C#
- Title
- C# check if is first run
- Category
- C#
- Title
- git checkout reset hard
- Category
- C#
- Title
- how to get component in unity c#
- Category
- C#
- Title
- C# .net core convert int to enum
- Category
- C#
- Title
- c# reverse string
- Category
- C#
- Title
- how to spawn coins randomly around the screen unity 2d
- Category
- C#
- Title
- unity making homing missile
- Category
- C#
- Title
- c# distinct array of objects by values
- Category
- C#
- Title
- c# remove spaces from string
- Category
- C#
- Title
- c# list length
- Category
- C#
- Title
- get gameobject child by name
- Category
- C#
- Title
- how to detected WindowCloseEvent in other window wpf
- Category
- C#
- Title
- f reachable queue in c#
- Category
- C#
- Title
- void start
- Category
- C#
- Title
- asp net identity add a unique fields to user
- Category
- C#
- Title
- C# how to expose an internal class to another project in the solution
- Category
- C#
- Title
- How to execute a script after the c# function executed
- Category
- C#
- Title
- how to load the active scene unity
- Category
- C#
- Title
- reverse string c#
- Category
- C#
- Title
- unity get all by tag
- Category
- C#
- Title
- C# get all files in directory
- Category
- C#
- Title
- enums c#
- Category
- C#
- Title
- enums as numbers c#
- Category
- C#
- Title
- csharp first element of array
- Category
- C#
- Title
- c# md5 hash file
- Category
- C#
- Title
- C# .NET Core linq Distinct
- Category
- C#
- Title
- matplotlib measure the width of text
- Category
- C#
- Title
- How to look at an object unity
- Category
- C#
- Title
- asp.net tag helper checkbox
- Category
- C#
- Title
- how to raycast unit
- Category
- C#
- Title
- C# public 2d array
- Category
- C#
- Title
- how to a equall to b in c#
- Category
- C#
- Title
- open new window c# wpf
- Category
- C#
- Title
- c# events and delegates
- Category
- C#
- Title
- split using string c#
- Category
- C#
- Title
- what is the or symbol in C#
- Category
- C#
- Title
- doest all the methos in interface need to implement c#
- Category
- C#
- Title
- how to cjeck if a string has a word c#
- Category
- C#
- Title
- get number of sundays in a month c#
- Category
- C#