An unhandled exception of type 'System.Data.DBConcurrencyException' occured - vb.net

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

Related

An unhandled exception occurred while processing the request SqlException

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.

InvalidCastException was unhandled vb.net

Hi there this error message keeps appearing when i try to calculate my data.
You're using FileSystem.WriteLine rather than Console.WriteLine.
See the difference here:
https://msdn.microsoft.com/en-us/library/microsoft.visualbasic.filesystem.writeline(v=vs.110).aspx
https://msdn.microsoft.com/en-gb/library/system.console.writeline(v=vs.110).aspx

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.

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

Get more info from sqlclient error message

I connect my windows mobile app directly to ms-sql server using the sqlclient dll from microsoft.
Some times I get this error when trying to get some data from the server:
System.Data.SqlClient.SqlException: SqlException
at System.Data.SqlClient.SqlConnection.OnError()
at System.Data.SqlClient.SqlInternalConnection.OnError()
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
at System.Data.SqlClient.TdsParser.Run()
at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
at System.Data.SqlClient.SqlDataReader.get_MetaData()
at System.Data.SqlClient.SqlCommand.ExecuteReader()
at System.Data.SqlClient.SqlCommand.ExecuteReader()
Every time I have a error like this I need to try a few other things, some times the connection string is no good, or the network is not configured right or any other random problem.
Is there a way I could get a bit more info from the program so I shouldn't have to waste a few hours figuring out what might went rung?
That's basically just the stack trace. You should be able to get the Message property of the SqlException which contains the details. In some cases you will have to look at the InnerException to get to the interesting details.
Ok I found the answer... I changed: Catch ex As Exception To: Catch ex As SqlException
Now I get the specific error nicely displayed in the message.