An unhandled exception occurred while processing the request SqlException - sql

When I create a new project (web api) in Visual Studio 2019, I try running the project but I got the following error:
An unhandled exception occurred while processing the request.
SqlException: Invalid object name 'Books'.
Microsoft.Data.SqlClient.SqlCommand+<>c.b__169_0(Task result)

Did you check spelling in SqlDataReader? For me, I was misspelled. If the spelling is correct, any chance are you re-using the same name of an existing environmental variable for a different database on the same SQL Server? If the answer is yes it can be issue too.

Related

failed to connect to a database in B1if

sometimes i have this error when i try to connect to my database in B1if :
vBIU.errhdlg='' exceptionmsg='com.sap.b1i.xcellerator.XcelleratorException: XCE001 Nested exception:
com.sap.b1i.bizprocessor.BizProcException: BPE001 Nested exception:
com.sap.b1i.xcellerator.XcelleratorException: XCE001 Nested exception:
com.sap.b1i.xcellerator.XcelleratorException: XCE001 Nested exception: java.lang.RuntimeException: Connect to
Business One failed. (-119) Database server type not supported -b1Server=SRV-B1-HYPPROD,
company=SBO_HYPFR_PROD, licenseServer=HYP-B1-LIC:30000, dbType=7, dbUser=sa, userName=B1i-' msglogexcl='false'
handover2CentralSrv='' MessageLog='true' msglogdbop='insert'>
the question is how to fix that ?
The Error happens when B1i don't get a connection to the DB. That should not be a problem because B1i repeats the process after a minuten and then the connection should be there.
We fixed this by Installing the 64 Bit version of B1DIAPI.x64. Not sure why that worked.
Note you need to update the SLD links for your database and SBO-COMMON - the jcoPath will likely be different - replace the "Program Files (x86)" with just "Program Files".

Connecting to TFS Programmatically - Error: A first chance exception of type 'System.ArgumentException' occurred in mscorlib.dll

I have the following code which used to work and now no longer works:
collectionUri = New Uri(txtServerName.Text)
Dim tpc As New TfsTeamProjectCollection(collectionUri)
workItemStore = tpc.GetService(Of WorkItemStore)()
teamProject = workItemStore.Projects(txtProjectName.Text)
When my application hits the line: workItemStore = tpc.GetService(Of WorkItemStore)() I get the following error:
ArgumentException occurred
A first chance exception of type 'System.ArgumentException' occurred in mscorlib.dll
Additional information:
Requested value 'Information' was not found.
{System.ArgumentException: Requested value 'Information' was not found. at System.Enum.EnumResult.SetFailure(ParseFailureKind failure, String failureMessageID, Object failureMessageFormatArgument)}
I have uninstalled and re-installed Visual Studio 2013 ... same results. I have tried the application on another computer and it works just fine so I know my code is good.
I haven't touched this app in a few months so I'm not certain what would have changed. Any ideas?
Thanks.

An unhandled exception of type 'System.Data.DBConcurrencyException' occured

I'm doing a program using VB 2012 with microsoft access 2013 database in the middle of the coding I encountered this error "An unhandled exception of type 'System.Data.DBConcurrencyException' occured..."
Can anyone help me get through this error.
Thanks

DBNull error - 'System.InvalidCastException'

Using Visual Studio 2008 and generating .net 2.0 framework with VB.net for a web application.
I encountered a very strange problem currently. After I build a solution and click a link in a web page, I got an error message as following. The same thing happened when I tried to run in debug mode.
*************************************** ERROR Message ******************************************************
"An exception of type 'System.InvalidCastException' occurred in Microsoft.VisualBasic.dll but was not handled in user code"
"Additional information: Operator '=' is not defined for type 'DBNull' and string "". "
*******************************************************************************************************************
The problem part is simply as below in a vb file. The value of dataview(0)(“name”) is NULL and my_name is a variable string. The strange is thing I didn't change any code in this vb file. This vb file was built previously and used for a long time ago without any problem. It just suddenly happened today. I have this syntax all over the program without causing any problem. I have tried to restore the whole solution back to original but still have the problem.
Can anyone please advise why all the sudden and how to fix?
If dataview(0)(“name”) = my_name then …
Try to determine NULL value first ..
If NOT IsDBNull(dataview(0)(“name”)) Then
If dataview(0)(“name”) = my_name then
'codes here
End If
End If

Error Importing CRM4.0 Organisation in CRM 2011...Why does it fail??...

CRM 2011 Server and SQL Server 2008 R2 (running in same machine)...Installed CRM 2011 with Reporting extensions. When I try to import process the CRM 4.0 database through CRM 2011 Deployment Manager,it fails. I map all users and validation screen passes with warnings and without errors ...Why is it failing can someone point me into a right direction looking at the logs.
It doesn't take long before it fails...|I copied most frequent lines of the log before it failed...
Your help is much appreciated...
Info| Upgrading the views in the MSCRM database
Info| CrmAction execution time; UpgradeDatabaseAction;
00:21:23.6584839
| Error| Installer Complete: OrganizationUpgrader - Error encountered
|Error| Exception occured during
Microsoft.Crm.Tools.Admin.OrganizationUpgrader:
Action Microsoft.Crm.Tools.Admin.UpgradeDatabaseAction failed.
InnerException: System.Reflection.TargetInvocationException: Exception
has been thrown by the target of an invocation. --->
Microsoft.Crm.CrmException: SqlException: Invalid column name
'New_name'. Invalid column name 'New_Details'. Invalid column name
'New_Test'., View Script: if exists (select * from sysobjects where
name = 'New_action' and xtype = 'V') begin
drop view [New_action] end go
.......... ..........
System.Data.SqlClient.SqlException: Invalid column name
Could anyone please help me with this problem
Thanks in Advance
Prajosh
I found a solution - I added the missing columns manually