Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [c#]

C# is a general-purpose, managed, garbage-collected, object-oriented programming language created by Microsoft.

0
votes
0answers
14 views

How can I figure out the root cause of “Out of range value for column” error in MySQL

I have a console app written with C# on the top of .Net Core 2.2 framework with EntityFrameworkCore as ORM. My application runs various tasks that run every 15 minutes. Each task calls an external API ...
0
votes
0answers
19 views

Database design for multilingual tags

I'm looking for a simple database design for tags, where the tag-label can be translated (multilingual). I'm currently looking at Toxi, which is a very simple and clean way of creating a tagging ...
2
votes
1answer
80 views

Bind dll in SQL Server

I have a little side project at my work. My task is to deploy some SQLCLR code into our dev-database (SQL Server 2017) to test it. If the tests are successfull, we want to develop triggers and ...
0
votes
1answer
33 views

Conditional insert vs UNIQUE constraint

https://stackoverflow.com/questions/4069718/postgres-insert-if-does-not-exist-already I would like to check if something exists before inserting it, what should I rely on? UNIQUE constraint or ...
0
votes
0answers
26 views

SSIS: Retrieving the value of a Sensitive Parameter in a Script within a Package Part

I've been reading Matt Masson's article on how to read the value of a sensitive parameter in a C# script. However the script in question is in a package part, which does not seem to be able to access ...
2
votes
1answer
180 views

Error publishing SQLCLR C# Function using Visual Studio 2017

I'm trying to (learn) publish a SQLCLR function using Visual Studio 2017. (It's a simple function that sends an email.) As a reference I used this articles on CodeProject and MSSQLTips: Create, Run, ...
-2
votes
1answer
36 views

How Can i Parse the sms text to textboxes [closed]

how can can i do this ? i can't get the return value and i can understand how regex work . string value = "+CMT:"+639231568462"," ","18/10/07,14:31:32+32" HELLO" "; Regex r = new Regex(""); ...
0
votes
1answer
120 views

Check if master is up from slave server(replication) postgresql

I want to check whether my master server is up by querying from slave server ? Is there any view or command ?
1
vote
2answers
82 views

Saving SSIS package from server to local computer

Right now I'm able to upload an SSIS package from my local computer to SQL Server with my C# program: Microsoft.SqlServer.Dts.Runtime.Application app; app = new Microsoft.SqlServer.Dts.Runtime....
0
votes
1answer
30 views

unable to add data to table because related record is required

I have an access database with my work that I am trying to insert into but I keep getting. 'You cannot add or change a record because a related record is required in table 'Projects'.' I'm running ...
1
vote
1answer
6k views

Before and After update trigger on same table

I have a table with 4 columns qty, qtydiff, price and value. I want a after update trigger that fires when qty row values change (more than one rows). The Before trigger should read and store the old ...
1
vote
0answers
55 views

increment row and calculate amount - follow up question

This is a follow up to my original question, but anyone can answer nonetheless. Increment each row according to condition in SQL C# WITH upd AS ( SELECT [Bill No], Item_Name, ...
0
votes
1answer
55 views

How to ensure that row with same PK inserted replaces old row in MS SQL Server, instead of throwing exception of PK Violation?

I'm transferring bulk data from a C# DataTable into a SQL Server DB. The DataTable provides values for all 26 columns except the first column, which is an auto-incremental ID The schema skeleton is as ...
1
vote
0answers
428 views

Oracle Number (10, 0) decimal in (C#) code

The following query is executed to add a new column to an existing table: ALTER TABLE TABLE1 ADD COLUMN1 NUMBER(10, 0) DEFAULT -1 NOT NULL. Using DBForge to check the database, result in NUMBER (10, ...
0
votes
0answers
37 views

How to backup only primary filegroup ?

I need to exclude one of my table in database during backup. So I move the table to another filegroup "SECONDARY". bkpDifferential.Action = BackupActionType.Files; bkpDifferential....
1
vote
2answers
46 views

How to provide a SQL Server database with a C# application [closed]

I am working on a C# application which depends on a few SQL Server databases. Now, in my development environment, I am using SSMS (SQL Server Management Studio) to create and manage my databases. My ...
2
votes
3answers
504 views

Should I use SSIS to write programming logic?

I have come across a fairly complex system where the business logic is written in SSIS. Since SSIS is not able to perform a big portion of this logic, it is heavily dependent on C# script tasks to ...
2
votes
0answers
218 views

SSIS Script Component Not Logging

How can I log from within an SSIS Script Component? I am using the below code, which I believe should work. public override void PreExecute() { this.Log("Entering PreExecute()", 0, new byte[0]); ...
0
votes
1answer
518 views

how do you output a plsql array via ref cursor

I have a legacy procedure that returns a plsql assoc table to a C++ DLL. Now I need to call it via C# and ODP.NET. I have been unable to find any info on how to call a proc that returns a pl/sql ...
0
votes
1answer
69 views

Select data from a table and update a second table using most recent value [closed]

I have two table: Stampings and Registries. Stampings is populate from a program that read a CSV file and do an insert into the table. Some field into the table are: name, surname, card-code and ...
0
votes
1answer
105 views

Regular data transfer from SQL Server to MySQL

Our company uses an application with a SQL Server database where we store all of our Project Item data. Our company's Portal Website uses a MySQL database that holds other Project information (...
0
votes
3answers
77 views

SQL Server FullText searching on text that is slightly obfuscated before insert

Our app slightly obfuscates text before insertion to the database. This is done by the application (C#) and not the database. (This is not encryption but just to stop people who are looking at the ...
1
vote
1answer
532 views

What is the “Default Timeout” value in SQLite connection string used for?

I have looked at the SQLite documentation and I can't find anything clear about the value "Default Timeout". Looking at other websites, it seems to refer to some sort of "Connection timeout", while ...
1
vote
0answers
281 views

C# Windows Service task fails due to a SP timeout, but works fine after executing the SP in SSMS

I have a Windows Service app running and sometimes a task which has a method call to a stored procedure (with a Select operation) is keep failing due to a timeout. But when I execute that SP with ...
7
votes
1answer
389 views

Why would a foreign key from a table to itself cause a deadlock when running two deletes?

I have a database with a table "SelfRef". SelfRef has two fields: Id (guid, PK, not null) SelfRefId (guid, nullable) There is a foreign key constraint that maps the SelfRefId field back to the Id ...
0
votes
1answer
603 views

Create a maintenance plan for sql database with C#

We are planning to create c# jobs that perform some database maintenance actions such as backup, shrink files etc... I have read in many blogs that database shrink is not recommended and thats why I'...
1
vote
1answer
34 views

Joining tables on DB server vs App-Backend server

I have two tables stored on the DB server. I need to join these two tables and perform further calculations. I am sure that the calculations part should be done on backend server. But I am wondering ...
2
votes
3answers
910 views

AddWithValue performance and plan cache implications

Recently I noticed my company's application using AddWithValueto pass parameter values to dynamic, parameterized queries. Example: cmd.Parameters.AddWithValue("@VehicleId", Vehicles.VehicleId); In ...
0
votes
1answer
150 views

What is a staging table and how do you protect data loss when transferring the data?

What is a staging table? What is it used for? Are there best practices that should be applied? I'm working in Oracle right now. Are staging tables platform dependent? I'm performing a bulk copy with ...
6
votes
3answers
5k views

Pass datatable as parameter in PostgreSQL

I have one datatable in asp.net C#. And I want to pass that datatable into PostgreSQL function as a table parameter. How is it possible? Below example is same but it is in SQL Server. I need same ...
1
vote
0answers
145 views

SSIS log subcomponent name

I want to log information using a 2016 SSIS C# (2015) script task that will be easily findable in my SSIS reports I have built. My plan is to use the IDTSComponentEvents.FireInformation method, and ...
0
votes
1answer
251 views

Arithmetic Overflow at RunningPackages (SSIS) problem [closed]

I've developed an SSIS Package with the C# Code.All the Package were running fine.But for the past 2 days, we are experiencing public void Main() { // TODO: Add your code here ...
1
vote
2answers
2k views

SQL Server Order SELECT List with condition

I want order the select list with condition. For example; I have t1 table and it has 3 columns and 6 rows Table t1: +----+---+---+ | id | x | y | +----+---+---+ | 1 | a | 1 | | 2 | b | 3 | | 3 |...
3
votes
1answer
2k views

Unable to connect using Azure AD Service Principal on SQL Server

I'm having trouble testing a connection to Azure SQL Server using SSMS with an active directory service principal. I have an AD Admin account created, and have successfully added a colleague's AD ...
-3
votes
1answer
90 views

SQL Server database chooser

I remember I used to use a tool that displayed a form so that any reachable database could be selected, like the initial prompt when you open SSMS. I don't remember if it's a StackOverflow tool, ...
2
votes
0answers
449 views

What to do when you find slow running query?

I have two databases. One with 10.000 rows and one with 10 million rows. I have a load test and I am running it towards a rest api endpoint. This endpoint does a query to database and average ...
-1
votes
2answers
498 views

Get compressed data from sql server database to application

I have created a C# application. I have used sql server database for this application. When i run the application it communicate with the sql server and retrieve data. My problem is that when ...
0
votes
1answer
621 views

OleDBConnection.Close() very slow on server

I am working on a few applications which connect to an MS Access database backend (.mdb) to read/insert/update records. Everything is working fine, but I noticed that my db operations were quite ...
1
vote
1answer
2k views

Asynchronous database inserts from C# always result in a deadlock

I'm hoping this doesn't come off as too amateurish, but I'm converting a synchronous program to run asynchronously. So far, I've gotten everything running asynchronously except database inserts. ...
0
votes
1answer
293 views

Query fails from application but runs fine in SSMS

I have a query that runs fine when executed from SSMS but when done so from the application, it fails with a (database level) exception. select ksprintid from kshistory_akt h where cast(h.serialno as ...
7
votes
2answers
1k views

Why can't C# SMO see extended properties on a column but Powershell SMO can?

I am attempting to read extended properties on tables and columns in a winforms C# application. I am using SQL Server SMO to do so. When I execute the application it does not see the extended ...
3
votes
2answers
460 views

Can add one CLR function to SQL server but not a second in the same assembly: loading wrong DLL

With the following code, I used csc to compile the dll. I then added the assembly to sql server 2014 using CREATE ASSEMBLY ReplaceMultiWord from 'd:\bcp\ReplaceMultiWord.dll' WITH PERMISSION_SET = ...
0
votes
4answers
122 views

Speed to read small table

I am trying to react to a Sql Table change very quickly. I have set-up a SqlDependency in c# and on receipt I query the table for "New" records. My table contains a few thousand rows. There are 2 ...
3
votes
2answers
2k views

A Dynamic where clause in MS SQL Server

The Problem My SQL Server database contains a view that looks like the following: +-------------+-----------+------+-------+------+------+ | CAR_ID | MAKE |COLOR | Miles | Seats| MODEL| +--...
0
votes
1answer
64 views

Procedure returning different values

I have a procedure TempSalesUpdateID which gets all ProductName's column in TempSales table and set it's corresponding ProductID. ALTER PROCEDURE [dbo].[TempSalesUpdateID] AS UPDATE T SET T....
2
votes
1answer
115 views

150 External flat files used to create internal DB

I have a situation in which I must create an entire DB off of ~150 external txt files (pipe delimited) which all represent unique tables. Furthermore these txt files come in daily and need to be ...
2
votes
1answer
310 views

SELECT COUNT(*) returns no data SQL Server 2012

I have a query, that as far as I know has failed exactly one time. It's a simple select count(*) from one table, no joins. But at least this once, executing that query resulted in no data read from ...
1
vote
4answers
646 views

Load testing: The performance of a query is decreasing as the number of parallel executions is increasing

I'm seeing a slow down when doing load testing on my app. I have a query that takes about 350ms to run, but what I run it in parallel 8 times (not to mention 32 times), it goes up to 2.5 seconds. I ...
-1
votes
1answer
1k views

Can't connect to LocalDB from Visual Studio 2015

When I try to connect to the database, to which I was previously able to connect, I get the following error: I tried to solve this by looking up other stackoverflow questions and online resources, ...
0
votes
2answers
692 views

fetching Remote table data and storing into local dump file in pgSQL? [duplicate]

I want to copy one table's content from a remote machine to local. I have tried with psql Command \copy. It's working fine as "copy" is not working due to copying from remote. But is there any way I ...