All Questions
423 questions
0
votes
2
answers
107
views
How to use a parameterized query with "GO" statements in .NET?
I am using ASP.NET as a backend to an application to update some data in a separate system's SQL Server.
I have a query that needs to insert many rows to a table. In each row, the values being ...
0
votes
0
answers
44
views
Store object that has a List of objects as a property, without these objects generating a seperate table
I have this class that has 2 complex properties:
public class App
{
[Key]
public Guid Id { get; set; }
public string StringId { get; set; } = string.Empty;
public string AppName { get; ...
0
votes
0
answers
43
views
Convert GetDateTime to Time only format [duplicate]
I'm creating an events crud app and am trying to connect the "time" of the event from my database to my code. The data type in the database format is Time(7) and the asp.net code is ...
2
votes
5
answers
17k
views
Unable to create a 'DBContext'
i have the following error message:
Unable to create a 'DbContext' of type ''. The exception 'No database provider has been configured for this DbContext. A provider can be configured by overriding ...
1
vote
1
answer
43
views
NHibernate subquery to check atribute of referenced object
I need to filter a page of my Concept model, Concept references TelecoCompany, so I want to filter by the name of that TelecoCompany. I was having some errors while comparing, so I realized I need to ...
-1
votes
1
answer
104
views
IDENTITY_INSERT is ON but I get an SqlException saying it is OFF [duplicate]
This is my code :
public class OrderItem
{
[Key]
public int Id { get; set; }
public int Amount { get; set; }
public double Price { get; set; }
[ForeignKey("MovieId")]
...
0
votes
1
answer
53
views
Hashed and salted passwords are saved as random symbols in SQL database
Hashed and salted password look like this in the database:
Is this how it is supposed to be? Because the hash and salt that i get in the backend look like this:
0
votes
1
answer
748
views
ASP.NET project shows : System.Data.SqlClient.SqlException: Invalid column name 'Food_Id' error
return _entities.Restaurant.Where(x => x.Deleted != true).ToList();
This line shows the following error:
System.Data.SqlClient.SqlException: Invalid column name 'Food_Id'
I don't have any column ...
0
votes
0
answers
169
views
How to use App Pool Identity to connect using SqlClient in Powershell?
We have many servers with a ASP.Net application installed. I'm trying to figure out a automatic way to connect to the sql server using Powershell.
They use a domain account to run the app pool. I ...
0
votes
1
answer
1k
views
.NET application - Status Code: Error 302 Found
The .Net application if it is run on the server directly(localhost:5000), I can login without issue. However, if I access the application through IIS - http://hostname and try to login I get error 302 ...
1
vote
0
answers
793
views
net::ERR_HTTP2_PROTOCOL_ERROR in .NET 6
I'm developing an API in .NET 6 with 5 five controllers. All controllers are running good, but the deals controller are giving me that error.
When I set the results to .Take(100) then I get the ...
0
votes
1
answer
218
views
How to convert this sql query into linq query. I am stuck at the group by and sum part
My SQL query looks something like this :
The SQL query returns the revenue associated with every colorwaysid present
select p.colorwaysid,sum(oivs.actItemvalue+oivs.custom) as revenue
from Product p ...
-1
votes
2
answers
1k
views
What is the data type in ASP.NET Core for decimal(18,2) in sql
I have a Amount column in database which is in Varchar datatype, I am retrieving the data from table and I am casting for the amount should be returned as (12345.0,111.00) like this, so here I am ...
1
vote
2
answers
736
views
Left join and count based on multiple values using linq c#
I have 2 lists. List A consists of this value,
status | level
-----------------
open | low
open | medium
open | high
closed | low
closed | medium
closed | high
List B consists of this value,
...
-2
votes
1
answer
305
views
Simple select C# command - Beginner
Could you let me know where I am going wrong? I think its to do with the variable I have declared but I'm not sure
using System;
using System.Collections.Generic;
using System.ComponentModel;
using ...