Click here to Skip to main content
15,903,030 members
Home / Discussions / C#
   

C#

 
GeneralRe: == or String.Equals() Pin
S. Senthil Kumar24-Apr-05 19:12
S. Senthil Kumar24-Apr-05 19:12 
GeneralRe: == or String.Equals() Pin
tommazzo26-Apr-05 2:48
tommazzo26-Apr-05 2:48 
Generalwin form Pin
vuthaianh24-Apr-05 2:55
vuthaianh24-Apr-05 2:55 
GeneralRe: win form Pin
Polis Pilavas24-Apr-05 3:14
Polis Pilavas24-Apr-05 3:14 
GeneralRe: win form Pin
Nick Parker24-Apr-05 4:35
protectorNick Parker24-Apr-05 4:35 
GeneralRe: win form Pin
Polis Pilavas24-Apr-05 6:52
Polis Pilavas24-Apr-05 6:52 
GeneralExecute Stored Procedure... Pin
Illegal Operation24-Apr-05 2:53
Illegal Operation24-Apr-05 2:53 
GeneralRe: Execute Stored Procedure... Pin
Colin Angus Mackay24-Apr-05 3:42
Colin Angus Mackay24-Apr-05 3:42 
The same way you would execute a stored procedure anywhere else.

I'll assume you are using SQL Server 2000

SqlConnection conn = new SqlConnection(myConnectionString);
SqlCommand cmd = new SqlCommand(storedProcName, conn);
// Add any parameters to the command here
conn.Open();
// Run only one of the following lines depending on what you are expecting.
cmd.ExecuteNonQuery(); // Sproc returns no data 
myValue = cmd.ExecuteScalar(); // Sproc returns a single value 1st col 1st row
myReader = cmd.ExecuteReader(); // Sproc returns many rows

// Everything done. close the connection.
conn.Close();



My: Blog | Photos | Next SQL Presentation
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More


GeneralRe: Execute Stored Procedure... Pin
Illegal Operation24-Apr-05 4:05
Illegal Operation24-Apr-05 4:05 
GeneralRe: Execute Stored Procedure... Pin
Colin Angus Mackay24-Apr-05 4:11
Colin Angus Mackay24-Apr-05 4:11 
GeneralGarbage Collection - Question Pin
Tristan Rhodes24-Apr-05 0:33
Tristan Rhodes24-Apr-05 0:33 
GeneralRe: Garbage Collection - Question Pin
WillemM24-Apr-05 2:20
WillemM24-Apr-05 2:20 
GeneralIncluding a manifest file within the exe file Pin
Anonymous23-Apr-05 23:34
Anonymous23-Apr-05 23:34 
GeneralRe: Including a manifest file within the exe file Pin
DavidNohejl24-Apr-05 2:06
DavidNohejl24-Apr-05 2:06 
Generalwindows services Pin
sianatia23-Apr-05 23:18
sianatia23-Apr-05 23:18 
GeneralRe: windows services Pin
Claudio Grazioli24-Apr-05 6:14
Claudio Grazioli24-Apr-05 6:14 
GeneralList the files in another computer Pin
Johny Ng23-Apr-05 18:58
Johny Ng23-Apr-05 18:58 
GeneralRe: List the files in another computer Pin
lubos_h24-Apr-05 2:06
lubos_h24-Apr-05 2:06 
GeneralValue Types Vs Reference Types Pin
vchedalla23-Apr-05 18:57
vchedalla23-Apr-05 18:57 
GeneralRe: Value Types Vs Reference Types Pin
Colin Angus Mackay23-Apr-05 22:42
Colin Angus Mackay23-Apr-05 22:42 
Generalusing the serial port Pin
Mridang Agarwalla23-Apr-05 18:06
Mridang Agarwalla23-Apr-05 18:06 
GeneralRe: using the serial port Pin
Peter Ritchie24-Apr-05 8:21
Peter Ritchie24-Apr-05 8:21 
GeneralException handling problem.. Pin
23-Apr-05 13:51
suss23-Apr-05 13:51 
GeneralRe: Exception handling problem.. Pin
Carl Mercier23-Apr-05 14:03
Carl Mercier23-Apr-05 14:03 
GeneralRe: Exception handling problem.. Pin
Tugbay Sahin23-Apr-05 14:55
Tugbay Sahin23-Apr-05 14:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.