Click here to Skip to main content
15,890,438 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Let's Consider I am using 1 store procedure that return message if record save
then
Record Save Successfully with Grn No 1 and Sr No 3

numbers are calculated

and result is fetch by asp.net page
if record save then i want to show in message box
if any error occurs then then i want to show in Label

so my is query how to find means i am going to save result in String _result Variable
so how can i know that Record Save or error occurs
do ii have to use Linq or SubString and How??
Posted
Comments
Abhishek Pant 3-Jan-13 5:41am    
just perform and know it-Save or error occurs
Member-515487 3-Jan-13 6:04am    
what i want to show to the user grn no and sr no for his transaction in msg box
prashant patil 4987 3-Jan-13 6:11am    
@Member-515487: this task do urself.... if during coding any error occur then come for help here.
Sergey Alexandrovich Kryukov 3-Jan-13 17:57pm    
For a record: string does not return. String is not a method. :-)
—SA

What do you think LINQ is ? What do you mean by 'substring' ? You should call your data layer, and then check what values it returns, and write code to render the result as you expect. I think you're throwing around buzzwords with no clue what they mean.
 
Share this answer
 
"so my is query how to find means i am going to save result in String _result Variable
so how can i know that Record Save or error occurs
do ii have to use Linq or SubString and How??"


when you will call stored procedure to save date and your stored procedure does not contain any error handling technique, you will gotten error which you have to handled in application level.


and

"Let's Consider I am using 1 store procedure that return message if record save
then
Record Save Successfully with Grn No 1 and Sr No 3
"

return 1 from your stored procedure when your transaction is completed successfully, then in your application

C#
bool _result = Convert.ToBoolean(YourSqlCommand.ExecuteScalar());


and after that, see if you have true value or false in _result
C#
if(_result)
{
   // data saved, so show message
   HttpContext.Current.Response.Write("<script> alert('data saved'); </script>");
}
else
{
   // data is not saved, show error or any proper message you want here
}
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900