Click here to Skip to main content
15,897,891 members
Home / Discussions / C#
   

C#

 
QuestionHow can i Run my application form the WIndows service? Pin
Sifar - 025-Sep-08 0:12
Sifar - 025-Sep-08 0:12 
AnswerRe: How can i Run my application form the WIndows service? Pin
Venkat Eswaran25-Sep-08 4:22
Venkat Eswaran25-Sep-08 4:22 
QuestionRe: How can i Run my application form the WIndows service? Pin
Mark Salsbery25-Sep-08 7:33
Mark Salsbery25-Sep-08 7:33 
QuestionSetting property Enable32BitAppOnWin64 for IIS 7 in C# Pin
Mushtaque Nizamani24-Sep-08 23:48
Mushtaque Nizamani24-Sep-08 23:48 
AnswerRe: Setting property Enable32BitAppOnWin64 for IIS 7 in C# Pin
Pete O'Hanlon25-Sep-08 0:44
mvePete O'Hanlon25-Sep-08 0:44 
GeneralRe: Setting property Enable32BitAppOnWin64 for IIS 7 in C# Pin
Mushtaque Nizamani25-Sep-08 17:32
Mushtaque Nizamani25-Sep-08 17:32 
GeneralRe: Setting property Enable32BitAppOnWin64 for IIS 7 in C# Pin
Mushtaque Nizamani8-Oct-08 19:23
Mushtaque Nizamani8-Oct-08 19:23 
QuestionIDbParameter return value string only gives first character Pin
jVersteegen24-Sep-08 23:35
jVersteegen24-Sep-08 23:35 
hello
I am trying to get the return parameter from database stored procedure (very simple basic test):

create procedure TQMSpGetConcattenatedString @string1 varchar(50),@string2 varchar(50),@string3 varchar(50) output
as
set nocount on
select @string3 = @string1 + @string2

works fine when execute in query analyser. Then try to execute from C# code as follows:

private static string test2()
{
IDbCommand cmd = Program.db.GetCommand ();
cmd.Connection = Program.db.Connection;
cmd.CommandText = "TQMSpGetConcattenatedString";
cmd.CommandType = CommandType.StoredProcedure ;

IDataParameter p1 = Program.db.getDataParameter ();
p1.ParameterName = "@string1";
p1.Direction = ParameterDirection.Input ;
p1.DbType = DbType.String ;
p1.Value = "Monkey";
cmd.Parameters.Add (p1);

IDataParameter p2 = Program.db.getDataParameter ();
p2.ParameterName = "@string2";
p2.Direction = ParameterDirection.Input ;
p2.DbType = DbType.String ;
p2.Value = "Tail";
cmd.Parameters.Add (p2);

IDataParameter p3 = Program.db.getDataParameter ();
p3.ParameterName = "@string3";
p3.Direction = ParameterDirection.Output;
p3.DbType = DbType.String ;
p3.Value = "-";
cmd.Parameters.Add (p3);

cmd.ExecuteNonQuery ();
return p3.Value.ToString();
}

the return string only has 1 character in it. When i use SqlParameter it works good.
Does anybody have a suggestion for me?
AnswerRe: IDbParameter return value string only gives first character Pin
Pete O'Hanlon25-Sep-08 0:09
mvePete O'Hanlon25-Sep-08 0:09 
GeneralRe: IDbParameter return value string only gives first character Pin
jVersteegen25-Sep-08 0:16
jVersteegen25-Sep-08 0:16 
GeneralRe: IDbParameter return value string only gives first character Pin
Ashfield25-Sep-08 0:24
Ashfield25-Sep-08 0:24 
GeneralRe: IDbParameter return value string only gives first character Pin
jVersteegen25-Sep-08 0:37
jVersteegen25-Sep-08 0:37 
GeneralRe: IDbParameter return value string only gives first character Pin
Pete O'Hanlon25-Sep-08 1:08
mvePete O'Hanlon25-Sep-08 1:08 
GeneralRe: IDbParameter return value string only gives first character Pin
jVersteegen25-Sep-08 1:31
jVersteegen25-Sep-08 1:31 
GeneralRe: IDbParameter return value string only gives first character Pin
Pete O'Hanlon25-Sep-08 1:59
mvePete O'Hanlon25-Sep-08 1:59 
GeneralRe: IDbParameter return value string only gives first character Pin
jVersteegen25-Sep-08 2:29
jVersteegen25-Sep-08 2:29 
GeneralRe: IDbParameter return value string only gives first character Pin
jVersteegen25-Sep-08 2:39
jVersteegen25-Sep-08 2:39 
QuestionDateTimePicker and BindingSource Problem Pin
Ahmad Safwat24-Sep-08 23:31
Ahmad Safwat24-Sep-08 23:31 
AnswerRe: DateTimePicker and BindingSource Problem Pin
Acid_Inex25-Sep-10 18:25
Acid_Inex25-Sep-10 18:25 
AnswerRe: DateTimePicker and BindingSource Problem Pin
PeSVe24-Aug-12 3:59
PeSVe24-Aug-12 3:59 
Questiondelegate Pin
Mogaambo24-Sep-08 23:26
Mogaambo24-Sep-08 23:26 
AnswerRe: delegate Pin
leppie24-Sep-08 23:28
leppie24-Sep-08 23:28 
GeneralRe: delegate Pin
Mogaambo25-Sep-08 0:08
Mogaambo25-Sep-08 0:08 
GeneralRe: delegate Pin
leppie25-Sep-08 0:16
leppie25-Sep-08 0:16 
JokeRe: delegate Pin
DaveyM6925-Sep-08 0:18
professionalDaveyM6925-Sep-08 0:18 

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.