I am using the above code for data entry into SQLite database, but while getting some string values, I am getting this error: ‘SQL logic error near “da”: syntax error’ What is the reason ? Answer You will get SQL syntax error if one of rehberIsmi, jsonData contains single quote. In your case, composing SQL query by concatenating strings is
Tag: c#
Extracting hashtags by sql
I have this problem – currently I am extracting hashtags in a C# application but now I want to move it to SQL Server. In C# I have code using a regex: In T-SQL, I would like to have something like this: Answer Using the string_split
How to use Distinct in entity/linq based on certain columns (Remove duplicated values)
I want to remove the duplicated values from the columns ” 1)LabelName, 2)OpenLabelStandard, 3)Type “. The issue is that my table has four columns. beside to the three previous columns I have another one called 4)’Distance’. it is not a field from database. I added it to my table using some calculations in view model. the distance column is changeable
how to make the datagridview load faster with Multiple Row query – c# SQL
The code: The SSMS output: The output form loads slowly, the rows for the query are over 1000 so I think the cause of the slow load is the number of returned rows? If yes, how do make the load of the datagridview faster? Answer NOTE – this answer relates to the first part of the original question regarding why
I didn’t true use order by in linq
Hi i develop web app with c#. I have sql query and i convert to linq but it’s not working true because of order by My sql query My linq Answer Here’s how you can do the order by on the count of each group and take the 3 with the highest count.
Parameter returning not in the correct format
I have an async task method that queries a database table for the total amount of Credits in a specific column. I have a string parameter in the method that I use for the query to identify which user is logged in, which is stored in Properties.Settings.Default.Student_Number;. The column for the student number in the database is a varchar and
Executing a StoredProcedure in Dotnetcore3.1
I created a Stored Procedure by Selecting values from 2 different tables. Now the problem I have is to execute and read the result data from my dotnetcore 3.1 code. I am not sure if the code I have written is correct. I am using IQueryable<AppUser> but, The SP contains a mix of AppUser and CourseMarks. So can I represent
How to delete only Top 100 rows which are older than 30 days from current date in C#? [closed]
Closed. This question needs debugging details. It is not currently accepting answers. Want to improve this question? Update the question so it’s on-topic for Stack Overflow. Closed 6 months ago. Improve this question When I execute following query , it is executed properly in SSMS but same query in code does not delete anything and 0 rows are affected from
get request to accepts params in postman, currently sends a unsupported media type error
I’ve built different get methods using body request to select an id (with raw json). However, as I learned that get methods doesn’t support body request, I would like to change so that I can use params in postman insted. However, when I do it now, I get an 415 Unsupported Media Type. Here’s the method: Controller: Interface class: Before
add sql WHERE statement to select new ID:s in database (asp / sql)
I’m trying to update a website where there’s new ID’s for different damage groups. All the new ID’s start after ID 139. In SQL the statement to get the new groups are simply: However, I want to implement the same statement in my ASP code and in the method that fetches the current damage groups. Here’s the current method for