Skip to content
Advertisement

Tag: c#

Issues with Dapper query syntax

little assistance here with my query using dapper, been getting error Message = “ORA-00936: missing expressionn” on my query. I would like to know what am I missing here? Answer Firstly with Oracle queries you need to use : instead of @ to denote a parameter placeholder. Then secondly this code: will produce an object with a property called RouteId.

DataTable ‘Table’ already belongs to this DataSet – on a new DataSet?

I have a function that executes SQL queries and returns a generic DataSet of the query results. This function has been working for years in many applications, but today with a specific query I am getting “Error executing [select top (1) RecordId, SourceCID, SourceID, CaseID, DisposeRequestedDate, DisposeRequestedBy, DisposeApprovedDate, DisposeApprovedBy from mycatalog.dbo.CASD_RetentionManagementDisposalApprovedQueue order by DisposeApprovedDate, RecordID;] A DataTable named ‘Table’ already

Unexpected token when creating a string expression?

I have the following code: There is an error here ‘{cardId And it tells me Invalid Expression term ” Answer You need to be aware that this kind of string concatenation is avoided and it is open to SQL Injection attack, you should always use parameterized queries to avoid SQL Injection and also to get rid of errors, something like

How can I group a joined query with linq

I’m trying to produce a data set for a graph that would get me the same result as the following SQL query: But if I try to translate it into a linq query, I can’t get the same result, I either don’t have access to one or the other side of the junction, or I get a yearly total of

C# INSERT to SQL method exception when DateTime parameter is null

One of my parameter looks like this: I know that User has null value in last_sign_in_at. Database accept nulls for this column but I get an exception: SqlException: The parameterized query ‘(@id int,@name nvarchar(18),@username nvarchar(11),@state nvarch’ expects the parameter ‘@last_sign_in_at’, which was not supplied. Answer You should be using DBNull.Value: Casting to object here is just for operator ?? to

Advertisement