Click here to Skip to main content
15,901,205 members
Home / Discussions / C#
   

C#

 
QuestionHow to save listview data to database? Pin
Tuntgerhuu25-Jan-09 16:08
Tuntgerhuu25-Jan-09 16:08 
AnswerRe: How to save listview data to database? Pin
N a v a n e e t h25-Jan-09 17:27
N a v a n e e t h25-Jan-09 17:27 
GeneralRe: How to save listview data to database? Pin
CooperWu25-Jan-09 17:48
CooperWu25-Jan-09 17:48 
GeneralRe: How to save listview data to database? Pin
N a v a n e e t h25-Jan-09 18:02
N a v a n e e t h25-Jan-09 18:02 
GeneralRe: How to save listview data to database? Pin
Tuntgerhuu25-Jan-09 18:30
Tuntgerhuu25-Jan-09 18:30 
QuestionCalling a stored procedure with a return value help please Pin
stored25-Jan-09 15:08
stored25-Jan-09 15:08 
AnswerRe: Calling a stored procedure with a return value help please Pin
ToddHileHoffer25-Jan-09 16:07
ToddHileHoffer25-Jan-09 16:07 
GeneralRe: Calling a stored procedure with a return value help please Pin
stored25-Jan-09 16:23
stored25-Jan-09 16:23 
the -1 is just an intercept if i cannot create a connection.

the return code from the stored proc will be a distinct value and never a -1 thus the -1 for the connection.

Can I use the ExecuteNonQuery() - Since i am only interested in the return code supplied.
Also it is my understanding the params need to be in a distinct order and defined?
I have changed the code around a little to...

For brevity i left the connection part out. Also i am 100% confimred the stored proc is working.
Another wrote that, but we tested extensively prior to implementing within this section of code.
And yes, if the DB cannot be connected this is ok.

SqlCommand command = new SqlCommand("the_storedProc", con);
command.CommandType = CommandType.StoredProcedure;

SqlParameter param = new SqlParameter();
param = command.Parameters.Add(new SqlParameter("@FilePath", SqlDbType.VarChar, 120));
param.Direction = ParameterDirection.Input;
param.Value = fullPath;  // this is a string i pass in with the full path

param = command.Parameters.Add(new SqlParameter("@FileType", SqlDbType.VarChar, 120));
param.Direction = ParameterDirection.Input;
param.Value = type; // string i pass in with the type

param = command.Parameters.Add(new SqlParameter("@Return_cd", SqlDbType.Int, 8));
param.Direction = ParameterDirection.Output;

command.ExecuteNonQuery();

GeneralRe: Calling a stored procedure with a return value help please Pin
stored25-Jan-09 17:33
stored25-Jan-09 17:33 
QuestionC# Reporting.. Application settings Pin
Jacob D Dixon25-Jan-09 13:10
Jacob D Dixon25-Jan-09 13:10 
AnswerRe: C# Reporting.. Application settings Pin
Not Active25-Jan-09 13:52
mentorNot Active25-Jan-09 13:52 
QuestionLoad corrupted HTML into XML document Pin
Lutosław25-Jan-09 12:39
Lutosław25-Jan-09 12:39 
AnswerRe: Load corrupted HTML into XML document Pin
Ravi Bhavnani25-Jan-09 15:19
professionalRavi Bhavnani25-Jan-09 15:19 
GeneralRe: Load corrupted HTML into XML document Pin
Lutosław26-Jan-09 7:18
Lutosław26-Jan-09 7:18 
AnswerRe: Load corrupted HTML into XML document Pin
Bruce Duncan25-Jan-09 18:59
Bruce Duncan25-Jan-09 18:59 
QuestionRe: Load corrupted HTML into XML document Pin
Lutosław26-Jan-09 7:14
Lutosław26-Jan-09 7:14 
Questioncall delegate Pin
abu rakan25-Jan-09 11:20
abu rakan25-Jan-09 11:20 
AnswerRe: call delegate Pin
Wendelius25-Jan-09 11:25
mentorWendelius25-Jan-09 11:25 
GeneralRe: call delegate Pin
abu rakan25-Jan-09 11:34
abu rakan25-Jan-09 11:34 
GeneralRe: call delegate Pin
#realJSOP26-Jan-09 0:02
professional#realJSOP26-Jan-09 0:02 
GeneralRe: call delegate Pin
Wendelius26-Jan-09 6:23
mentorWendelius26-Jan-09 6:23 
Questiondoes Any on have a Idea Pin
mnssr25-Jan-09 7:09
mnssr25-Jan-09 7:09 
AnswerRe: does Any on have a Idea Pin
Wendelius25-Jan-09 7:26
mentorWendelius25-Jan-09 7:26 
AnswerRe: does Any on have a Idea Pin
User 665825-Jan-09 9:51
User 665825-Jan-09 9:51 
AnswerRe: does Any on have a Idea Pin
Pete O'Hanlon25-Jan-09 10:38
mvePete O'Hanlon25-Jan-09 10:38 

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.