This is a migrated thread and some comments may be shown as answers.

Input string was not in a correct format

2 Answers 142 Views
Getting Started
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jonathan
Top achievements
Rank 1
Jonathan asked on 25 Jan 2014, 11:20 PM
Hello,

I decided to try and explore this tool today, so downloaded and installed the latest version. I'm using Visual Studio 2013 Professional.

I have attempted to use code first creation of the db, and it seemed to work, in that I got no generation errors, and when I updated the database from the model, it created the tables as I expected.

However, when I try to use it in code, I get the following:

"An exception of type 'Telerik.OpenAccess.OpenAccessException' occurred in Telerik.OpenAccess.dll but was not handled in user code

Additional information: Input string was not in a correct format."

This occurs on every single entity I try to query.

Example code that causes this issue is:

var dbContext = new HwyData.HwyEntitiesModel();
var up = dbContext.UserProfiles.FirstOrDefault<UserProfile>();

I even tried creating a single entity, with just an id and a string in it, and it still errored out for that.

I'm at a loss as to what to do now as I'm clearly missing something.

2 Answers, 1 is accepted

Sort by
0
Jonathan
Top achievements
Rank 1
answered on 26 Jan 2014, 06:40 PM
Just thought I'd follow up here. After struggling to no avail, I decided to just wipe out the tables from the database, wipe out the mappings and start again. 

This time it worked. From what I can tell, I didn't do anything differently on the two attempts.
0
Jan Blessenohl
Telerik team
answered on 27 Jan 2014, 02:53 PM

Hi Joathan,

We are lazy opening the database, I guess that your connection string was wrong and we are checking it too late. If you can send us the stack trace I can tell you more.

Because you have already solved the problem, I guess you do not have it anymore.



Regards,

Jan Blessenohl
Telerik
OpenAccess ORM Q3 2013 simplifies your model operations even further providing you with greater flexibility. Check out the list of new features shipped with our latest release!
Tags
Getting Started
Asked by
Jonathan
Top achievements
Rank 1
Answers by
Jonathan
Top achievements
Rank 1
Jan Blessenohl
Telerik team
Share this question
or