Microsoft.Data.SqlClient.SqlException: 'Invalid object name 'AbpEditions'.' - asp.net

I am new in the database & backend area, and there is a web application, which in the "aspnet-core" file of the app; when I Run a solution on Visual Studio, after connecting to the Azure SQL, the error
Exception User-Unhandled
Microsoft.Data.SqlClient.SqlException: 'Invalid object name 'AbpEditions'.'
would you please give a hint about how to handle the mentioned issue?
Thanks,

the field that you are using in the controller is call "AbpEditions" so checkout the name of the table in the database they should match.

Related

ASP .net core time out error using Oracle

I'm new to ASP .Net Core and am working my way through a demo project to learn the tech stack.
My project is using .net core 2.2 and Oracle.ManagedDataAccess.Core and Oracle.EntityFramework.Core.
I created a model and then went and scaffolded my view and controller through VS 2019. I've set up ConfigureService(...) to use Oracle. I added an HTML link on my main index page to hook into the view created for my model. When it calls the Controller::Index() function, I end up getting the following timeout error
OracleException: Connection request timed out
OracleInternal.ConnectionPool.PoolManager<PM, CP, PR>.Get(ConnectionString csWithDiffOrNewPwd, bool bGetForApp, OracleConnection connRefForCriteria, string affinityInstanceName, bool bForceMatch)
Any help or guidance as to what I could be doing wrong would be greatly appreciated!
It looks like a error connecting to the database.
There are some things you should check:
Make sure the connection string to the database, stored in the appsettings.json is correct.
Make sure to have a firewall rule which allows inbound traffic to the port from where the Oracle db is listening.
If the problem persists then you should provide the code you are using to access the database.

Cannot open database requested by the login .Login failed for user

I have few aspx pages and and few tables in database. Each page connects to respective table. The purpose of each page is the same, only some condition are different. When I develop I use different database for testing data and called it "Database_DEV1" to be easy to remember. Now a problem is that only one page connects to the database (Database_DEV1) with same connection string. Other pages throws error with message:
Cannot open database "Database" requested by the login. The login failed.
Login failed for user 'xxx'
Why does it connect to "Database" if I provided connection string that refers to Database_DEV1?
Is it possible that this kind of error may appear at all? Do I miss something? I checked connection string I provided.
It looks like page "remembers" something different for some reason. I tried simple SqlConnection class and it works, but dbml file not.
update
Problem is that that Context refers to folder:
// C:\Users\xxx\AppData\Local\Temp\Temporary ASP.NET Files\root\0f053840_shadow\2edebf24\5576\App_Code.whnwybua.dll
At first, application connects using context that is declared in dbml. But when I do some actions it tries to connect using context which refers to dll file I described above. Why is that?

Azure Website doesn't recognize my Database's Table after changing the Schema

I have a Microsoft Azure Website running and working with an Azure SQL Database for the sole purpose of storing and retrieving user accounts. However I needed a mobile client as well there fore according to numerous tutorials online such as THIS, I had to change the 'schema' of the database's table from 'dbo' to my mobile service's name which is 'usermobileservice'.
This was done using the SQL query:
CREATE SCHEMA usermobileservice;
ALTER SCHEMA usermobileserviceTRANSFER dbo.usertable;
This did the trick and I was able to connect to the Database using my mobile applications BUT now I can't access the database using my Azure Website! Gives me this error:
Server Error in '/' Application.
Invalid object name 'UserTable'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Invalid object name 'UserTable'.
I believe the ASP.NET Web Application cannot find the Database Table anymore since I changed the schema? What is the right way of sharing the data between a Website and a Mobile Service?
For those of you having the same issue, Just replace your SQL queries that call the table (where the schema was changed) with this:
your_mobile_service_name.Your_Table_Name
In my case:
usermobileservice.UserTable
Example:
SELECT * FROM usermobileservice.UserTable
Thank you #Brendan Green for the directions!

error in event viewer

I have two question....
when i drop some Edi file in receive location......if there is some error in file.....we get some error in event viewer(I guesss these are receive pipeline error).....
my first question is
can we se this error in the sql server .................In which database and table we can see event viewer error.
My second question is
can we get this error and write into some file through biztalk.
my first question is
can we se this error in the sql server .................In which database and table we can see event viewer error. --> I guess No.
My second question is
can we get this error and write into some file through biztalk. --> Yes you can do that. following are few ways
1.Use Enterprise Library logging and catch the error in pipeline if you are using custom pipeline and write those errors in flat file
2.if you use SCOM , it will automatically poll all the errors related with BizTalk in event viewer and sends notifications to you.
3.Write a custom service using .net and read the event logs on each bizTalk nodes, later you can either write them in flat file or push them in database tables.
Check out http://msdn.microsoft.com/en-us/library/aa578516.aspx. You could route the message to a file and or SQL table.
If you turn on BAM and EDI reporting there will be a nicer view in the admin console.

System.Data.EntityCommandExecutionException: An error occurred while executing th

I have created a connectionstring in mvc3 application and it is working fine in mvc views and controllers and I am able to fetch data. Now I have called the repository/model functions in a Unit Test in Test project and I am getting error:
System.Data.EntityCommandExecutionException: An error occurred while executing the command definition. See the inner exception for details. ---> System.Data.SqlClient.SqlException: Invalid object name 'dbo.tblProduct'.
How can i fix it?
That has nothing to do particularly with MVC. As it seems, when testing, you use ConnectionString on database that does not have 'dbo.tblProduct' table/view. Check the connetion string and database. You may need to debug tests
Check your table may have different schema (other then dbo) change it to dbo using query below
look at this.
How do I change db schema to dbo
Its very strange for my case, as it is required to do mapping between model and tables, the name has to be the same. When I added 's' at the end of table's name, it works. I don't know if this part work of what LINQ does.

Resources