All Questions
934
questions
0
votes
2
answers
113
views
Why isn't searching on an indexed column faster than a string comparison?
I was asked for a demonstration of how searching on an indexed column is faster than searching for a string prefix, so I created a quick test but the results were surprising and I can't see why.
The ...
2
votes
1
answer
58
views
Operand type clash: int is incompatible with date in sql [duplicate]
i using am writing a insert statement but getting above error
Insert query
var insertSql = string.Format(
$"INSERT INTO Sales (Date, Team, Sales) VALUES ({0}, {1}, {2})",
...
2
votes
2
answers
237
views
When Should I Use connection.OpenAsync in Dapper?
I am using "Using" Statement like this:
using (SqlConnection connection = new(ApplicationSettingsData.ConnectionString)
{
// connection.Query();
}
As I Searched and understand about the ...
1
vote
2
answers
176
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
...
0
votes
1
answer
43
views
System.Data.OleDb.OleDbException: 'No value given for one or more required parameters.' in da.Fill(dt)
I'm doing this thing in C# Windows Form where it counts rows by group in Access Database and displays the total number of that group in dataGridview. But when I run it, I get a message that says:
...
0
votes
1
answer
34
views
C# MS Access OleDb can't make write operations
I have a database in MS Access and I am trying to edit the table (db). SELECT works for me but edit operations like INSERT, SET and DELETE does not change anything.
I have this code below that deletes ...
0
votes
0
answers
43
views
Multiple criteria search button with regex(patterns)
When I run the following code it works just fine. The only problem is that when the first textbox pattern is respected the datagridview shows data and no error message even though the other textbox, ...
0
votes
0
answers
42
views
connection class with SelectCommand.parameters.AddWithValue queries
The method for retrieving data from a connection class was decleared as
public void retrieveData(string command)
The SqlDataAdapter as
SqlDataAdapter da = new SqlDataAdapter(command, conn);
How do i ...
0
votes
0
answers
85
views
DataSet table is not null even there isn't any values at row [0]
I have following code where I get dataset through method readAvgReview.
If dataset [0] table includes any avg values (between 1-10) I want to display values to the page.
If it doesn't include these ...
0
votes
1
answer
594
views
Serializing SQL Json response
I have an SQL query that returns a json response. Query was parsed using FOR JSON AUTO on the database. The issue I am having is when I query the database in my application I get the backslashes. ...
0
votes
0
answers
60
views
How to post foreign key that’s passed from another action controller as a primary key? (ADO.NET ASP.NET MVC)
I have tables:
Shipment (ssuid, sCompanyName, sFName, sMName, sLName, sAddress1, sAddress2, sCity, sState, sPostalCode, sCountry)
Packages (ppuid, psuid, pTrackingNumber)
where psuid is a foreign ...
0
votes
1
answer
97
views
How do I pass foreign key to View page? (ADO.NET)
I have 3 SQL tables for my web application.
Shipment(ssuid, sCompanyName, sFName, sMName, sLName, sAddress1, sAddress2, sCity, sState, sPostalCode, sCountry)
Packages(ppuid, psuid, pTrackingNumber)
...
0
votes
2
answers
210
views
C# - Windows Form - Delete Button - Won't Properly Execute SQL Command
I am attempting to create a simple Windows Form application that can interact with a database to manage some data. I've run into an issue in my attempts to make a delete button, I've made similar ...
2
votes
1
answer
291
views
C# Insert Multiple Records into Database Table
I have a role based permission login which determines the menu options available to the logged in user.
Currently when saving a new Role I make use of a stored procedure.
using (SqlCommand cmd = new ...
0
votes
1
answer
136
views
Detect and avoid 100% CPU usage due to incorrect join query
We have a C# application in which the end user can connect to their database server and run a query to fetch the data. We execute the query using ADO.NET in the codebase and process the data according ...