323 questions
-1
votes
1
answer
108
views
Reason for report file loaded in my Windows Forms application being empty?
What could be the reason for the report file I designed in FastReport and loaded in my Windows Forms application being empty? In that file, my query is a simple join with only one int column, and no ...
-1
votes
1
answer
72
views
How to keep existing value (append) while using SqlParameter to update a record
I want to update a column in SQL Server by keeping its original value and appending new value separated by comma. It can be done like this:
string sql = "UPDATE Table SET Column = Column + ', ...
0
votes
1
answer
92
views
Using SqlParameter with DataTable.Compute
Can SqlParameter only be used with SqlCommand? I would like to use parameters within the DataTable.Compute() function, but I'm not sure exactly how to do that correctly.
Here is my partial function:
...
0
votes
0
answers
69
views
Issue with Procedure or function has too many arguments specified
I'm facing a problem where I was prompted that I'm passing too many parameters even though I defined it to both stored proc (SQL Server) and VB.NET:
ERROR:
System.Runtime.InteropServices.COMException:...
1
vote
1
answer
118
views
Powershell script communicating with SQL, won't take in values with apostrophes
I'm trying to automate inserting values from a CSV into a table in a SQL database. Everything is getting transferred into the database just fine with exception of any names with apostrophes. I tried ...
-1
votes
1
answer
2k
views
EF Core 8 does not inject parameters in raw SQL query
I need to build a raw SQL query and I am using the new EF Core 8. But when it executes the query, it seems that the parameters are not getting replaced.
private static FormattableString ...
1
vote
2
answers
377
views
SQLCommand parameter is throwing "InvalidCastException"
I have an old C# application that stopped working when updating the database using SqlCommand. I pull in a user object and update the values in a MSSQL database.
The error I'm receiving is below
...
-1
votes
1
answer
444
views
When calling a stored procedure with ADO.NET, how do I tell what parameter types the database actually used?
I have a stored procedure call in C#. It uses ADO.NET to call the stored procedure that is on my SQL Server. Despite knowing that one of the parameters of the stored procedure on the server is VARCHAR(...
0
votes
1
answer
153
views
From a parameter-usage viewpoint, is calling a table-valued functions from ADO.NET the same as a stored procedure or the same as a parametrised query? [closed]
This article warns of the performance pitfalls of using parametrised queries rather than stored procedures. The basic idea is that the server has to guess the data type of your parameters and its ...
0
votes
1
answer
263
views
Is AddWithValue only dangerous for strings?
Several answers give you warnings about AddWithValue. These two links are commonly given. The impression that I get is that it's dangerous because AddWithValue has to guess the SQL type of your C# ...
0
votes
0
answers
56
views
Use SQL parameter to filter multiple comboboxes in vb.net
How can I filter multiple combo boxes value in vb.net with SQL server query? All the comboboxes are user input.
Example:
I have cboName.text, cboAge.text, cboAddress.text
SELECT name, age, address
...
0
votes
1
answer
766
views
Azure Synapse: Output param execution into a temporary table
I have the following script which works perfectly fine in SQL Server, but fails in Azure.
declare @comm nvarchar(max)
declare @table table(comm nvarchar(max))
set @comm=' select '' ALTER TABLE '' ...
0
votes
0
answers
99
views
Parameterized query, parameter not passed Error, only on Win 11 asp.net Web Api
The web Api works 100% on windows 10 but as soon as I run it on a windows 11 machine it doesn't work.
The error I get.
System.Data.SqlClient.SqlException (0x80131904): The parameterized query '(@...
0
votes
0
answers
76
views
How to pass Array of params in sql param [duplicate]
I am trying to pass array of parameter to SQL query as a parameterized query.
SELECT D.PATIENTID AS PATIENTID,
D.FNAME AS FIRSTTNAME
FROM DETAILS D INNER JOIN PATEINT P ON P.PATIENTID=...
0
votes
1
answer
295
views
How to compare the stored procedure's output?
I want to check first if the user exists or not so I made a stored procedure in my SQL Server to check that.
CREATE PROCEDURE Login
@username varchar(20),
@password varchar(20),
@status ...