Hello i have a table called Card_tbl with a cell CardID. The problem is that when i insert only numbers like 12345 they are uploaded in the database, but when i use mix letters like Q1234R it will say INVALID COLUMN NAME Q1234R I tried many things to fix it but no success. THE CELL IS ON VARCHAR(50) this is
Tag: c#
Cascading combo box
I am trying to bind 2 combo box, being the value of the second dependent from de first. All the solutions that i saw to this problem were by the use of Sql.Data (Datatable), which i cant use, due to the architecture of the application. I can do it 2 ways, by c# or through ASP Object Data Source. I’ve
In c# app, how to connect foreign key of subtask table in SQL?
I am trying to create a Task Management System using C# Web API & SQL Server. Here is what I am trying to achieve: Users can send POST requests to create a Task (with optional sub-tasks). Users can send GET requests to retrieve a Task (displaying all sub-tasks in the response if they exist) Here are some of my current
C# select SQL query with parameter
I would like to migrate database from MS Access to SQL Server and I’m trying to modify my SQL queries. In MS Access they worked. I have this C# code: Connection method : SQL query is working but not returning rows. I guess that problem is a syntax of parameter in query. Can someone direct me? Answer You must not
How to write just one query to divide result from 2 query?
I have a query in Entity Framework Core like below: I am dividing one currencyRate to another from 2 queries. There are 2 select queries. Only difference between queries is where condition. How to do this in one select query? Answer Pull both rows with Put an explicit order by on like Now you know the two rows you get
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 get the closing time of day in timing schedule that spans multiple days
Assume I have the following table called Timing: Obviously each row represents a shift in a specific day. A day can have non-overlapping multiple shifts. If a shift spans the next day it will be splitted at midnight, and the second half would have a parent id of the first half (as you can see in row 24 and 31)
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
Having weird exception using MAX(CASE WHEN) in query: DB2.iSeries.iDB2DCFunctionErrorException: ‘An unexpected exception occurred
I have the following query to put some data from rows in columns: But when I try to run it in the following code: I get this exception: “IBM.Data.DB2.iSeries.iDB2DCFunctionErrorException: ‘An unexpected exception occurred. Type: System.AccessViolationException, Message: Attempted to read or write protected memory. This is often an indication that other memory is corrupt..'” I have other queries that work just
Conversion failed when converting the varchar value ‘ AND ID =’ to data type int
I was looking how I can parameterize table names and so I found dynamic sql queries. I finally got the proc saved, but when I execute it errors out with “Conversion failed when converting the varchar value ‘ AND ID =’ to data type int.” I have no idea what is going wrong when I try to execute this stored