Click here to Skip to main content
16,010,544 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: run a process for every new entry in a database Pin
liz320-Mar-09 18:37
liz320-Mar-09 18:37 
NewsRe: run a process for every new entry in a database Pin
Yusuf21-Mar-09 3:48
Yusuf21-Mar-09 3:48 
AnswerNeed some more clarity on your problem Pin
David Mujica23-Mar-09 3:39
David Mujica23-Mar-09 3:39 
GeneralRe: Need some more clarity on your problem Pin
liz32-Apr-09 5:27
liz32-Apr-09 5:27 
QuestionDisplaying a return value from Stored procedure in C#.Net Windows form Application Pin
Best120-Mar-09 5:07
Best120-Mar-09 5:07 
AnswerRe: Displaying a return value from Stored procedure in C#.Net Windows form Application Pin
Abhijit Jana20-Mar-09 5:22
professionalAbhijit Jana20-Mar-09 5:22 
AnswerRe: Displaying a return value from Stored procedure in C#.Net Windows form Application Pin
Colin Angus Mackay20-Mar-09 5:22
Colin Angus Mackay20-Mar-09 5:22 
AnswerRe: Displaying a return value from Stored procedure in C#.Net Windows form Application Pin
jaypatel51220-Mar-09 18:26
jaypatel51220-Mar-09 18:26 
Dude you need to do is something like this. .



SqlCommand cmd = new SqlCommand();
cmd.Connection = cn;
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "YourStoredProcedureName";

cmd.Parameters.AddWithValue("FirstName",this.FirstName);
..
..

Parameter param = new Parameter("ID");
param.Direction = Output.


And in Stored procedure it should be like this.



[dbo].[RecordCustomer]
@FirstName char(25),
@LastName char(25),
@EmailAddress char(40),
@ID int output
AS
begin transaction


insert Customers(LastName, FirstName, EmailAddress)
values(@LastName, @FirstName, @EmailAddress)
select @id = @@identity

commit transaction



And to get the value you need to do is

int res = Convert.ToInt32(cmd.Parameters["ID"].Value);

there you get the result..
Do whatever you want to do with it ..
And please post your windows application queries in C# forum
QuestionMaster Page Pin
deepam8320-Mar-09 4:15
deepam8320-Mar-09 4:15 
AnswerRe: Master Page Pin
Jörgen Andersson20-Mar-09 5:28
professionalJörgen Andersson20-Mar-09 5:28 
AnswerRe: Master Page Pin
cmk21-Mar-09 6:44
cmk21-Mar-09 6:44 
QuestionGridView - CheckBox Question Pin
jpduto20-Mar-09 4:01
jpduto20-Mar-09 4:01 
AnswerRe: GridView - CheckBox Question Pin
Abhijit Jana20-Mar-09 4:59
professionalAbhijit Jana20-Mar-09 4:59 
GeneralRe: GridView - CheckBox Question Pin
jpduto22-Mar-09 21:13
jpduto22-Mar-09 21:13 
AnswerRe: GridView - CheckBox Question Pin
annapurna.tiwari25-Mar-09 23:17
annapurna.tiwari25-Mar-09 23:17 
QuestionHow to install windows service on server Pin
sjs4u20-Mar-09 3:52
sjs4u20-Mar-09 3:52 
AnswerRe: How to install windows service on server Pin
Abhijit Jana20-Mar-09 4:54
professionalAbhijit Jana20-Mar-09 4:54 
GeneralDatagrid problem Pin
pjcunn20-Mar-09 3:17
pjcunn20-Mar-09 3:17 
GeneralRe: Datagrid problem Pin
Herman<T>.Instance20-Mar-09 13:16
Herman<T>.Instance20-Mar-09 13:16 
QuestionLocalization/Multi-lingual website in asp.net 2.0 or later Pin
hozsam20-Mar-09 2:58
hozsam20-Mar-09 2:58 
QuestionSession problem (Urgent Please) Pin
Bishwaraj Nayak20-Mar-09 2:34
Bishwaraj Nayak20-Mar-09 2:34 
AnswerRe: Session problem (Urgent Please) Pin
Greg Chelstowski20-Mar-09 2:45
Greg Chelstowski20-Mar-09 2:45 
GeneralRe: Session problem Pin
specialdreamsin20-Mar-09 18:21
specialdreamsin20-Mar-09 18:21 
GeneralRe: Session problem Pin
jaypatel51220-Mar-09 18:32
jaypatel51220-Mar-09 18:32 
GeneralRe: Session problem Pin
specialdreamsin20-Mar-09 18:46
specialdreamsin20-Mar-09 18:46 

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.