94 Replies
conn
is null@Kouhai are you here
Yup!
this is the connection string
why it's return null ?
Changed
ConnectionString
to ConnectionStrings
new error
The entity type 'USERINFOTEST' requires a primary key to be defined. If you intended to use a keyless entity type, call 'HasNoKey' in 'OnModelCreating'. For more information on keyless entity types, see https://go.microsoft.com/fwlink/?linkid=2141943.
Can you show your db models?
when i put [key] the new error is fetch:
Connection string is not well-formed
this is my connectionsring code
How i can fix it ?
Weird, looks fine to me
give you team viwer to see the code ?
Have you tried connecting to the db using any 3d party tools with same connection string?
Sry, can't rn 😄
no
Try DBeaver, free open source sql client
my company works in SQL Oracle Developer
Never used it, don't know how it works 😅
Well, you could also try removing couple of sections from the connection string and re-adding them till the error shows up again
this is true in Program.cs ?
Yes, that's correct
What happens when you hard code the connection string in Program.cs file, does the same error show up?
i dont understand
Try to replace
string conn = builder.....
with
string conn = "data source=192.168.1.34:1521/orcl;password=RHODES_HR;persist security info=True;user id=RHODES_HR;pooling=true;"
Does the error still show up?Yeah connection string is read correctly
No need to replace conn
Weird
yes the same error
try to remove the last semicolon here
this same
the same error *
can't spot anything wrong at all with the connection string tbh
~~
it's so bad :/
Can you try running with a debugger again and checking conn...
Hmmm, try again after removing the trailing semi colon
remove ; ?
3 semi colon delete ?
Yeah, only the last one
The one after
Pooling=true;
i try it but not work
Yeah, I know, just want to make sure the connection string was read without a
;
😅now work :/
you connect to your db using oracle sql developer you mentioned?
Also, try to remove the space before "Password" idk if it'll affect it that much
i can connect to db
Okay, one last thing, can you send the appsettings.json where the connection string is located in?
Send it as an attachment
And if you have any confidential info. make sure to delete them before sending here
You can try to connect using this connection string, I usually connect to oracle using tnsnames.ora file
@penera the same error
i will send you the project files
Check if this formatting is correct:
Don't have an access to any oracle instance right now to try it out
i can access to db
the same error
ok
cannot help you then ;/
@Rana Can you show your db context
Voila!
delete it ?
Yeah, just delete it, you don't need to override in your case
new error
Basically you were connecting using
"OracleConnectionString" not the actual connection string
Try testing the connection in database developer, does it timeout?
it's connect
Okay
Try to increase the timeout in your connection stirng
how ?
add
Connection Timeout=200
In the connection string
like this
?
Yup!
the same
Can you show the GetData endpoint?
I'm not entirely sure what can cause timeout with an oracle db, but can you check current connections in sql developer?
yes it's connect to db
No I mean like
Can you check how many connections currently exist?
45
45 with the ASP app running?
when i run the asp it's 41
And when you close it?
45
now 41
And when you try to access GetData ?
48
So when the request is made it's always over 45
Connection request timed out
the appsettings is correct ?
and this is the Program.cs
it's ture?
This is wrong
the same
i try 10000 connection strings
can you try to remove pooling?
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.