922 questions
1
vote
1
answer
355
views
Compare Combining Diacritical Marks and Latin Extended Additional in SQL Server, C#
Problem: two same word below are not equal (try "PHƯỢNG" == "PHƯỢNG" in console)
PHƯỢNG
PHƯỢNG
Describe :
The 'Ợ' characeter in the first word is using Combining Diacritical Marks : U+01A0 + U+...
-2
votes
1
answer
82
views
Replace a List with an array
I have the following method which I show below:
public static string loadLista(string pStrOp)
{
System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection(System....
1
vote
3
answers
12k
views
sql command returning boolean for processing in C#
Is it possible to return a boolean from a sql command - and then use it C#?
I currently have a database, in which I insert entries. I want before inserting know whether the entry exist, if so do ...
0
votes
1
answer
36
views
query returns no record using CONTAINS() VSS asp.net
Im having trouble on returning records using contains(transact-SQL).
this query has results on SQL server query window using static value
select * from archive_master where docgroupID=46 and( ...
0
votes
1
answer
92
views
Does SqlCommand.ExecuteNonQuery() insert previous rows before an error?
I have a temp table in sql server that I have created. I have the commandText of the sqlcommand object to insert from the temp table to another table. My question is: Does it insert the rows before ...
0
votes
0
answers
44
views
Getting strange JSON result when downloading a document
My process is simple, in the view:
function DownloadDoc(id) {
if (!isGuid(id)) {
ErrorDialog("#MessageDialog", "#lblError", "The value passed is not a valid GUID.", "Invalid GUID");
...
0
votes
0
answers
64
views
in C# forms ,notification window is populated even no code is written
I am writing a program to create a system tray to popup messages.
In the program I check if its a valid user and then a notification will be displayed
else
no notification message will be displayed.
...
2
votes
1
answer
5k
views
C# ASP.NET Web Api Controller - Get all rows from a table using SqlCommand
I'm making a web api server that I need for a school project because we have to make several applications on different platforms to communicate through messages and the web api server has GET, POST ...
0
votes
1
answer
202
views
Non-invocable member 'DetailsForm.cmd' cannot be used like a method
I`m trying to make command work but it doesnt work help please. this error appears at cmd("delete
i have sqlcommand cmd;
private void DeleteRecordBtn_Click(object sender, EventArgs e)
{
...
-2
votes
2
answers
90
views
MYSQL- command for copy value in column with same id
i need help to create the right MySQL command.
As you can see in attachment ,
i need to copy string from column value with attribute_id 78 in column value with attribute_id 77 WHERE the entity_id is ...
0
votes
1
answer
214
views
SqlCommmand parameters not adding to UPDATE statement (C#, MVC)
If you look at the stuff commented out, I can easily get this to work by adding user input directly in to the query, but when I try to parameterize it, none of the values are being added to the ...
0
votes
1
answer
388
views
SQL select for serial column
Assume I have a data with columns :
aa1, aa2, aa3, aa4, aa5, aa6
and so on.
I 'm looking for a select query where I can just mention something like :
select aa[1 to n] from table...
Is there any ...
0
votes
1
answer
2k
views
Error: "Invalid column name", but columns have already been created
I have created a web project, but when I try to insert values into my local database I get the following error:
Error : Invalid column name ''22 478 295 290''. Invalid column name ''Oreki''. Invalid ...
0
votes
3
answers
230
views
SQL Exception was unhandled-An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred in System.Data.dll
SQL Exception was unhandled-An unhandled exception of type System.Data.SqlClient.SqlException occurred in System.Data.dll
public DataSet getCustomers()
{
string Connectionstring = ...
2
votes
3
answers
6k
views
How to write a SqlCommand query that adds (numerical) input values to existing (numerical) column values
I want update several columns in a table by adding a value to existing values in those columns. Here is my current code:
cmd = new SqlCommand("UPDATE Users SET Debit=@debit,
...
1
vote
1
answer
971
views
SqlException occurred in System.Data.dll but was not handled in user code
I'm trying to run this method from a AJAX in ASP.Net with Razor. I don't have any visible error but every time I try to run it sends me this. I have a method like this running perfectly. But I guess I'...
1
vote
1
answer
94
views
Sqlcommand going cahtch
I got exception after result. Why is sqlcomm trying to find doTable default table string 'blTableName'? I'm not sending anywhere this name to sqlcomm so I need to see sqlcomm executed SQL query.
It ...
0
votes
0
answers
47
views
Execute non query returns negetive one(-1) but still inserts [duplicate]
In my understanding, the execute nonquery command in C# SQLCommand has to return the number of affected records, I have used this SQLCommand with SQL Transaction, it return a negative one but when I ...
2
votes
1
answer
2k
views
How could I pass parameter to sqldataadapter?
I have tried to pass parameter a value, but what it returns is nothing. If I use a simple sql command without parameter I can retrieve all the data from my database.
Here is my code:
Public ...
-1
votes
1
answer
1k
views
SSIS - How to insert into OLE DB destination using SQL command while the source is flat file?
I want to know how to insert value in SQL Server database with the flat file source in SSIS using SQL command. I've done inserting it using table view, now i have to insert it using SQL command
0
votes
2
answers
87
views
SQL command - Getting all column entry from a not so unique ID
I'm trying to list all data in the Color column field as the following:
Y, M, C, K, O, crystal barrier flood, hr matte uv flood
but I'm having trouble because the UniqueProdID are all the same.
...
1
vote
3
answers
3k
views
Add string array to SQL query
I have a string array which consists of identifiers. I want to get some values from SQL using these identifiers . Is there a way of adding them with a string value to SqlCommand parameters?
I want to ...
0
votes
0
answers
396
views
incorrect syntax near 's' vb.net
I'm getting the error Incorrect syntax near 's'. Error appears after inputting data in SQL sometimes it doesn't appear but when same characters will input the error appears.
Error lined in the ...
1
vote
2
answers
1k
views
Can not run cmdshell @command in SQL Server Express
I can not run cmdshell @command commands in my SQL Server Express. Is it something to do with the SQL Server version? Should I have to have like SQL Server Standard edition to run this command?
0
votes
1
answer
156
views
How to restrict to execute a single sql query using OleDbCommand
I have tried to give multiple insert or update in single query like
OleDbCommand command = new OleDbCommand("INSERT INTO Employee (Id,
Name, Address, Salary) VALUES (2001, 'name1', 'address1',
...
0
votes
4
answers
814
views
c# SqlDataReader Not Finding Value
My Problem has Been Fixed, My main problem was getting the information from the textbox in the xaml which got erased after that window was closed and another opened. Though the answers did fix my ...
1
vote
1
answer
656
views
Not allow Nested SqlCommand?
I have 2 SqlCommand's, one of them is nested. Why it does not allow me to issue the second SqlCommand (I am using a separate SQLCommand)? It gives an error
There is already an open DataReader ...
0
votes
1
answer
3k
views
How to store results from SQL query and use it?
I am trying to see whether the type is either a the letter "T" or between number 1-6 for the specific data entry found with name and password.
sql = 'SELECT type FROM table name WHERE name = "{}" ...
-2
votes
1
answer
4k
views
SqlConnection and SqlCommand with using statement
I have a connection to a database set up like this to call a stored procedure. I am just wondering if this is the best way to do this.
I have two using statements one for the sqlConnection and one ...
0
votes
4
answers
55
views
SQL: Access database once and get the number of data AND the data
I am new to SQL, and I have been wondering if there is an efficient way to get the number of data that match a condition AND the data both in one SQL command.
Specifically, what I want to achieve is:...
5
votes
1
answer
12k
views
SqlClient.SqlCommand.ExecuteScalarAsync behaving like synchronous call
I've stripped my application down to a minimal POC and I'm still getting the same effect. It appears that ExecuteScalarAsync is behaving like a synchronous call. I thought that when the await is ...
0
votes
2
answers
571
views
Sql commands Syntax Error: System.Data.SqlClient.SqlException: 'Incorrect syntax near ','.'
I am building a Point of Sales system in C# and I am passing the data from the Interface through an object to the database.
The update function throws a Syntax Error in cmd.CommandText every time I ...
2
votes
1
answer
273
views
Why is OLE DB Command trying to update the schema?
I have an SSIS data flow task that is taking lookup matched records and feeding them to an OLE DB Command component. When I run it I get an error that says:
Error: 0xC0202009 at Data Flow Task, OLE ...
0
votes
3
answers
1k
views
How to add a collections of parameters to an SqlCommand before query execution in C#?
I have this code where I want to add a collections of Parameters to an SqlCommand.
public void AddParameters(Dictionary<string, object> parameters)
{
if (parameters == null)
return;
...
1
vote
4
answers
2k
views
How to extract data from 1st day of the month till today's date -1
I am trying to extract all the data that has the datetime from 1st day of the month till yesterday, for example:
01/06/2017 - 22/06/2017
I have used this code:
Select *
from testDb.dbo.Company1
...
0
votes
5
answers
8k
views
Selecting from a SQL table but there is an exception thrown
I get this error when I want to read the table:
System.Data.SqlClient.SqlException (0x80131904): Incorrect syntax near ','.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception,...
0
votes
1
answer
623
views
Read a SqlCommand column (multiple rows) into a single C# byte[] array
Given a SQL table Document with data:
ID Content ByteLength Sequence
1 Part1... 945669 1
1 Part2... 945669 2
1 Part3... 945669 3
...
2 Part1... 45234 ...
2
votes
1
answer
35
views
Any one given this role should be able to assign privieleges to other ORACLE COMMAND LINE
The Question given in Past Exam was
you need to give academic role the ability to select from, insert
into and modify existing rows in Student table. Anyone given this
Academic role should be ...
0
votes
1
answer
3k
views
How to pass Dictionary parameters in SqlCommand
I have a dictionary(Dictionary dic); the key and value change dynamically.
How to use the Insert command to add record to SQL Server depends on the dic's content?
For example:
if dic={{"KeyA", "...
-1
votes
1
answer
2k
views
How to convert sqlDataReader to Task async
I have the following code-can anyone please tell me if I can make this a async Task
public MDTO GetIe(MDTO dtoItem)
{
string[] Tables = new string[] { "C", "CValue", "SP", "Ar", "P", "...
0
votes
1
answer
383
views
C# sqlcommand If not exist code error
public void Test2()
{
string consString = ConfigurationManager.ConnectionStrings["constr"].ConnectionString;
using (SqlConnection con = new SqlConnection(consString))
{
...
0
votes
3
answers
975
views
Adding single quotes around a string given from raw_input
I'm creating SQL commands from given input:
def do_add(self, table, full_sql_command="INSERT INTO {} VALUES ({})"):
""" Add a column to a specified table name """
add_command = raw_input("...
0
votes
1
answer
768
views
i'm in trouble with datareader
having a problem with this part of my code, with datareader.
foreach (Giorno iDet in iNom.Gg.Where(x => x.minRegular != 0 | x.minOver != 0 | x.minLate != 0))
{
bool Importato = false;
com =...
0
votes
1
answer
4k
views
Add parameter to ADO NET Source SSIS
I have parameter into SSIS:
and I try to use that parameter into query like:
How do I call my parameter v_sEstatusPresupuesto at final of my query?
I try to use @v_sEstatusPresupuesto but it don´t ...
0
votes
1
answer
137
views
How can write I sql query with rails commands
My sql command like this. Im trying to relation with two tables. I need the write that query to ruby command with rails helpers.
select *,
(select branch_id
from branches_course_contents
...
0
votes
1
answer
278
views
SQL Server TIMESTAMP values OUTPUT parameters and ADO.NET
Consider this simple SP:
create proc Updater
@id int,
@name varchar(25),
@rowversion timestamp
as
begin
update FOO
set name=@name
where id = @id and rowversion = @rowversion;
...
2
votes
1
answer
3k
views
Reading 200MB file from db throws Out Of Memory Exception
I am attempting to query the database and pull excel files that could be as large as 1 million rows (~200MB) stored as varbinary and pass it through a validator.
Our build server has 6GB of memory ...
-1
votes
2
answers
518
views
SqlCommand doesn't UPDATE and DELETE database when used in ASP.NET
I am having trouble with UPDATE and DELETE data in database when working with ASP.NET web form, the code work well with Windows form so I don't know what I did wrong. The code is suppose to update the ...
4
votes
2
answers
6k
views
how to see the SQL commands in App Insights executed by QA environment of API app?
We developed API Application and published it into Azure using DevOps with two environments like Dev and QA.
In Dev environment we are able to see SQL queries executed by APIs, but in QA environment ...
3
votes
2
answers
901
views
How to override SqlCommand to grab generated TSQL
Is there any way to intercept the SQL that's generated by SqlCommand?
I currently have a method that will execute a stored procedure:
public int ExecSP(string spName, params objec[] params)
{
...