8
Answers

Error in asp.net at runtime

 at local its working perfectly but when i hosted it on server i get runtime error how can i deal with it any help is apprecited

Error converting data type nvarchar to decimal.

 
Answers (8)
0
Sundar

Sundar

NA 9.6k 94.4k 7y
Check your parameters with SP parameters. You are calling some decimal parameter. Else paste your DB Parameters and ADO.NET Parameters. I will check and update you. 
Accepted
1
Nilesh Shah

Nilesh Shah

NA 22.3k 214.9k 7y
are you taking any input from user?
 
if yes, then have you taken care so that user can only enter number in textbox and not the alphabets?
0
Carnation Flowers

Carnation Flowers

NA 258 9k 7y
i found error becz i used cookie wich store userid  its int value 
i transfer it into nvachar its worked
but still dont understand why its give error as if it was Decimal
and another Question
can i replace the cookies with session and i wounder if session can be used on Project level or just in some folders
thakyou for each help
i m wating for answers 
0
Hariharan Krishnamoorthi

Hariharan Krishnamoorthi

NA 568 11.8k 7y
It would be better to share your code in this thread.
0
Rajkiran Swain

Rajkiran Swain

NA 33.9k 373.2k 7y
Example :
txtrate_km.Text.IsNullOrEmpty() ? DBnull.value : Decimal.Parse(txtrate_km.Text)
0
Carnation Flowers

Carnation Flowers

NA 258 9k 7y
there is no decimal value at all in this page
0
Sundar

Sundar

NA 9.6k 94.4k 7y
Your passing NVARCHAR to Decimal. Pass the parameter as Decimal. 
 
Parameter Value is Decimal, but your are pass a nvarchar value to database / SP. Change that to correct Datatype.  
-1
Mani Kandan

Mani Kandan

NA 2.6k 135.5k 7y
Hi Carnations Flower,
 
I would pefer that Anti-CSRF token implementation. ASP.NET provides the Guid class which implements a NewGuid method to generate unique 128-bit integer. Please refer this web page:
 
http://paladion.net/secure-coding-techniques-in-asp-net-part-2/
 
https://books.google.co.in/books?id=RUnG_uewR8wC&pg=PA378&lpg=PA378&dq=new+HttpCookie+Guid.NewGuid()+asp.net&source=bl&ots=WDPiAtSD2S&sig=bnBC4V0sbhxx8tuUD-MrKExaU7w&hl=en&sa=X&ved=0ahUKEwjgipilrsrUAhUHKo8KHWmyCDkQ6AEISjAG
 
Cheers!!!