6
Answers

.Net Entity Framework to DB2

Sarika k

Sarika k

14y
4.7k
1
Hi,

I am trying to connect to the DB2 from entity frame work (.Net 3.5. using Db2 add-ins). But it throws the following error: Does any one know how to fix this.


---------------------------
Microsoft Visual Studio
---------------------------
An error occurred while connecting to the database. The database might be unavailable. An exception of type 'System.Data.EntityCommandExecutionException' occurred. The error message is: 'An error occurred while executing the command definition. See the inner exception for details.
The inner exception caught was of type 'IBM.Data.DB2.DB2Exception', with this error message: 'ERROR [42622] [IBM][DB2] SQL0107N  The name "RETURNDATETIMEPRECISION" is too long.  The maximum length is "18".  SQLSTATE=42622
'.'.
Answers (6)
0
matt cupryk

matt cupryk

NA 29 0 14y
this can be because of the dateformat in windows. check it out. I've seen this before.
0
Sarika k

Sarika k

NA 16 0 14y
I found the problem, I am trying to connect to the older version of DB2 on Mainframe, which is not supported by entity frame work.

anyway thanks for your help Suthish.
0
Sarika k

Sarika k

NA 16 0 14y
I just checked the Tables check box  in the wizard to connect to the db, to get all the tables in that database. but it fails t retreive the table with that error.

0
Suthish Nair

Suthish Nair

NA 31.7k 4.6m 14y
how you retreiving the table data, using stored procedure?
0
Sarika k

Sarika k

NA 16 0 14y
I haven't created any methods yet, I am just trying to connect to the existing DB2 database, throught Entity frame work, on the wizard I enetered the connection string, connection was successful but it fails before retreiving the tables from DB2 with that error.
0
Suthish Nair

Suthish Nair

NA 31.7k 4.6m 14y
Because your method name (RETURNDATETIMEPRECISION) is too long. The error 42622 explains that. Use a shorter name for the object.