Questions tagged [c#]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
349 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
1answer
17 views

Conditional multi table insert

My application parses a web resource for data constantly. The data is then used to build a domain object. The domain object is represented in my database across several tables. The domain object is ...
1
vote
2answers
106 views

Identifying Unused \ Garbage Objects of a database

How do I find in use db objects from all application pages is there any tool or trick I can use, just like we do search in Visual studio for an object in entire solution
0
votes
1answer
33 views

First-In and Last-Out times for Night Shift and Day Shift Employees

Kindly share suitable technique to handle night shift as well as day shift. Below are the shifts, Night, 2020-07-20 17:00 to 2020-07-21 02:00 Night, 2020-07-20 17:00 to 2020-07-21 02:00 Day, 2020-...
0
votes
1answer
133 views

End of file reached. Error 38 in SQL. Passes verification checks

Having issues restoring a database in SSMS, error 38. The databases are transferred up to google via their Drive API. Download it on my side and has error. If I transfer it through teamviewer ...
1
vote
1answer
23 views

Upserting 50K records into big table (app. 350 columns) in postgresql

Using C# I'm trying to upsert from csv file (~ 55000 records) to a postgresql table with 350 columns. I'm just building the upsert statements from header and record which are comma separated. Like ...
0
votes
0answers
22 views

Sql service broker and SqlDependency

I have a system where my TCP/IP command prompt application receive data and insert that data in [database1].[mytable]. Now I want to move that data from [database1].[mytable] to [database2].[...
2
votes
0answers
36 views

Modeling Device Relationships

At currently I am designing an inventory system for internal use and I have come across an interesting scenario when adding tables for creating the devices. Currently I have tables for Device, ...
0
votes
1answer
20 views

i have error in query [closed]

i am not getting what is the issue in the query probably i am not following the correct way to put the string and char sign , i am inserting the data in c# to local host with where clause please check ...
0
votes
0answers
6 views

Gridview Computation of Specify rows

protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { decimal k=0; foreach (GridViewRow row in GridView1.Rows) { ...
0
votes
1answer
24 views

Login failed for newly created user

I just created my first database yesterday. It is now set up and I can write to it from my C# application using the admin user login. I would now like to use a limited write only user so my admin ...
1
vote
1answer
97 views

Should I move ORDER BY to app?

I noticed this discussion on NOT using ORDER BY in SQL query unless really necessary. https://www.brentozar.com/archive/2019/10/how-to-think-like-the-sql-server-engine-adding-an-order-by/amp/ The ...
4
votes
2answers
2k views

Daily database maintenance using SQL Server 2008 and a stored procedure

I have created a database maintenance plan using wizard though that link for SQL Server 2005. I have created a Maintenance Plan for SQL Server 2008 and it works fine. Now I required to complete the ...
3
votes
2answers
22k 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 ...
0
votes
4answers
154 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 ...
-2
votes
1answer
335 views

How to group by linq based on input parameter? [closed]

I want to use group by in C#, and my result must be like this code in SQL: SELECT MAX(EffectiveDate) AS EffectiveDate,details.PersonnelBaseID FROM dbo.tkp_PersonnelDetails AS details where details....
5
votes
1answer
169 views

System.Web in SQL Server CLR Function

I have done some light research into this topic and I would like to know what are all the pro's and con's or enabling/registering this particular .dll within SQL Server? Back information - we are ...
0
votes
0answers
12 views

I need to know how many connections are using mongodb when an error comes up

According with this https://stackoverflow.com/questions/7446528/mongodb-c-sharp-driver-doesnt-release-connections-then-errors it doesn't really close the connections used, there's a way to know how ...
0
votes
0answers
21 views

Creating database wherein there are multiple tables with same fields under different categories

We have vehicle/equipment repair workshops located at different places, these workshops send a monthly report in a standard format in MS Word file (attached a sample copy)to the headquarter(HQ). The ...
1
vote
0answers
82 views

What would be an appropiate BatchSize for bulk insert 34 GB of data (JSON files) into SQL Azure?

I got like 25,000 JSON files whose size (in average) is 1.2 MB (also, the average of records per JSON is 5,000), and the total size is like 34 GB. I have been reviewed the BCP utility from SQL Server, ...
0
votes
1answer
64 views

Efficiently get first 10 results and total number of results

For a search page, I need the first 10 results and the total number of results of a query. That part is easy: SELECT TOP(10) ... FROM ... WHERE ... ORDER BY ... SELECT COUNT(*) FROM ... WHERE ... ...
1
vote
1answer
178 views

This failure occured while attempting to connect to the Principle server

One of our clients recently came to us with a problem he's facing while working with our application. The error in the log file is the next: System.Data.SqlClient.SqlException (0x80131904): Timeout ...
1
vote
1answer
249 views

Facing permission error while trying to execute a stored procedure published through CLR

I've created a stored procedure using SQL CLR c# stored procedure in Visual Studio 2017 and I've published it in MSSQL Server. Now I can see my stored procedure, but I face this error when I want to ...
0
votes
1answer
69 views

Use table in database like in excel [closed]

I'm writing a program for my client in C# Winform. And the client gave this excel sheet. Process I have a table that used to calculate BULK amount of alcohol by "DIP" and "SLIDE". In excel I need ...
0
votes
0answers
63 views

Configure MSLocalDB in a .NET config file

I have created a .NET Standard C# project and a SQL database in my LocalDB server (LocalDb)\MSSQLLocalDB. I have tried to configure the connection string in the project web configuration file but in ...
0
votes
1answer
37 views

How do you combine the input of three parameters into one?

I'm working on a query that will run via C# to SQL server. I'm trying to make the query flexible and provide parameters for all the inputs. Here is the query: SELECT Test_Matrix.tblTestMatrix....
0
votes
0answers
516 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 ...
1
vote
2answers
8k views

Table Design for Student Attendance hourly for each day

I have created a table (attendance_details) for storing every day attendance of Students in MySQL. Need to capture attendance for hourly (1-8hrs) every day. I have the student details in separate ...
0
votes
0answers
58 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
118 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
211 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
1answer
262 views

In which extent can I use the Oracle Data Provider for .NET Managed Driver?

Good evening everybody, I am planing to dive into the oracle database world. Additionally, I want to develop some tools, which make my life easy by checking and modifying information in different ...
3
votes
1answer
879 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, ...
1
vote
1answer
730 views

Could I use the SQL statement, SELECT * from sysobjects, with C# MySQL Connector - .NET?

I would like to port a SQL statement, SELECT * from sysobjects, written for Microsoft SQL Server to MySQL version 5.6. Could I use the SQL statement, SELECT * from sysobjects, with C# MySQL ...
1
vote
1answer
1k 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 ...
-2
votes
1answer
86 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
354 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 ?
0
votes
1answer
1k 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
2answers
335 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
36 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
0answers
61 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
502 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
1k 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, ...
1
vote
2answers
53 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
813 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
436 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]); ...
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 |...
0
votes
1answer
1k 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 ...
2
votes
0answers
544 views

Intermittent IOExceptions when connection with MySQL Connector/Net. Why?

I have a web application which uses a MySQL 5.7.13 server for storing its data. MySQL is running on Windows Server 2008 R2. A couple of month ago I started seeing exceptions like the following being ...
4
votes
4answers
19k views

Trying to connect to PostgreSQL with Entity Framework via Npgsql and C#

So, I'm new to databases and only have done a little with PostgreSQL before. I have C# (visual studio 2012) and have downloaded the Entity framework (6). I have also downloaded the latest Npgsql data ...

1
2 3 4 5