0

I am using asp.net 4.6.1 and am unable to create an account via Register Page.

The stored procedure aspnet_Membership_CreateUser gives the following error:

The conversion of a datetime data type to a smalldatetime data type resulted in an out-of-range value. The statement has been terminated.

I have tried googling it but have failed to find the solution to it.

The same functionality works fine locally creating an account on my local Sql db.

But does not create the account on server db.

sly_Chandan
  • 3,437
  • 12
  • 54
  • 83
  • Does this answer your question? [The conversion of a datetime2 data type to a smalldatetime data type resulted in an out-of-range value.\r\nThe statement has been terminated](https://stackoverflow.com/questions/10443669/the-conversion-of-a-datetime2-data-type-to-a-smalldatetime-data-type-resulted-in) – Jamshaid K. May 03 '20 at 21:06
  • Are you using smalldate as date column in sql? – Jamshaid K. May 03 '20 at 21:07
  • There is absolutely no change in the stored procedure in server and localy. It works with the same SP locally – sly_Chandan May 04 '20 at 01:15
  • Nobody said that, I asked what type are you using in sql for storing datetime? – Jamshaid K. May 04 '20 at 01:57
  • perhaps, posting your `sp` here and the way you are feeding it the datetime, would be helpful for us to distinguish. – Jamshaid K. May 04 '20 at 02:01
  • It's just a register page that's provided with framework. I'm not calling it explicitly to create an account. I'm fed up now – sly_Chandan May 04 '20 at 17:14
  • Fed up of what people asking to clarify what you mean? because nobody knows whats running inside your head. – Jamshaid K. May 04 '20 at 17:33
  • How can the same function work locally and not on server. – sly_Chandan May 04 '20 at 17:39
  • There could be many factors, it could be the datetime format that is maybe different on the server and it is not processing it well, it could be that your server has a slight difference in the schema, it could be a hundred things. Just, never get yourself frustrated. instead start looking or sharing the information along the question so other might help you out. – Jamshaid K. May 04 '20 at 17:43
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/213105/discussion-between-sly-chandan-and-jamshaid-kamran). – sly_Chandan May 04 '20 at 17:48

1 Answers1

0

Yep Buddy! Got that Fixed!

I was right about the aspnet_membership table.

Instead of importing membership and identity records, I had to create new entries in membership tables.

This time the Register page was able to create the User Account.

Thanks for being patient though, buddy..

Jamshaid Kamran, you kept my juices running.

sly_Chandan
  • 3,437
  • 12
  • 54
  • 83