Skip to content

How to get a count even if there are no results corresponding mysql?

I am formalating a query to give the number of reports submitted over the last year ordered by date. I get the current year and month with php: and execute the following query: SQL: And because there has only been 1 submitted in the last year it gives me only 1 result… But I would like the result set to

Sql Command Not Working

I wrote the following code, but nothing is being inserted into the database. I tried changing the SA password in the connection string to something incorrect and the code isn’t catching the exception. What am I doing wrong? Answer As stated by the OP in the comments. Once the try-catch was resolved it w…

Stored procedure returns int instead of result set

I have a stored procedure that contains dynamic select. Something like this: In SSMS the stored procedure runs fine and shows result set. In C# using Entity Framework it shows returning an int instead of IEnumerable? Generated function for usp_GetTestRecords Answer Entity Framework can’t tell what your …