Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

Questions tagged [c#]

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

47 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
2
votes
0answers
288 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]); ...
2
votes
0answers
354 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 ...
2
votes
0answers
521 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 ...
2
votes
0answers
443 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 ...
2
votes
0answers
918 views

Using C#, is there a method to restore a database from a multi-file backup detecting which files are full vs diff?

I know there is functionality to restore databases in C#, however if I am given 2 or more files in a directory containing a full and differential backup files I would like to: 1) Determine which file ...
2
votes
0answers
132 views

Splitting very large working table

I read the good posts here and here, but my scenario is a bit different, I cannot consider that older data becomes read-only data because any record in my Transactions table can be subject to updates ...
2
votes
0answers
424 views

MongoDB C# driver fails to reconnect after stepDown

I have an Elastic Beanstalk environment in AWS that constantly verifies the DB is accessible by querying the mongos for one document. We only speak to the DB routers and not to specific instances. ...
2
votes
0answers
321 views

Strugling with updating a cassandra row in FluentCassandra

I have this problem with using Fluent Cassandra in a test application. All I want to do is set the IsOnline field to true inside the SignIn method, but I keep getting the exception supercolumn ...
2
votes
0answers
404 views

going from heirarchical XML to heirarchical SQL tables then SQL to c# objects to go to user view, how should I store the data in the databases?

Hi I'm getting my data from a web service using their getData call and it comes in as fairly chunky heirarchical XML, first everything all at once, like <allData> <product1> <...
1
vote
0answers
25 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, ...
1
vote
0answers
58 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, ...
1
vote
0answers
779 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
0answers
186 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 ...
1
vote
0answers
361 views

How to create a stored procedure to update database after table edit

In a C# website application with a database, I set a gridView table so that I could edit the values in the table by row, but it appears that I need a stored procedure to do that. Below is the stored ...
1
vote
0answers
1k views

Is there a way of implementing a composite primary key with varying fields in MongoDB?

Here is the information about my development environment: -Mongodb 3.0.0 -Microsoft Visual Studio Professional 2013 -.NET Framework 4.5 We are trying to design some MongoDB collections at work ...
1
vote
0answers
55 views

Selecting aggregated string from database

I have a table in my database consisting of one column which is NewLanguage(varchar). I insert new languages to the table and I want to select the rows of the table and assign them to a string ...
1
vote
2answers
74 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
1
vote
0answers
404 views

Transfer an Advantage Database's Schema/Data to a PostgreSQL Platform Using C# Program

I am currently in the process of writing a .NET program with C# to transfer a database on a Sybase/Advantage 9.1 platform to a PostgreSQL 9.3.4 platform. I am doing this transfer in two stages - ...
1
vote
0answers
106 views

Rows do not match Subscriber and Publisher

I have an transactional replication setup with updateable subscription that is utilized by an Application. When I insert a project into the application, the msrepl_tran_version is different on the ...
1
vote
0answers
519 views

Oracle server session terminated by fatal error

I have an Oracle server running on Windows Server. When an INSERT statement runs I receive an Oracle Ora-00603 error. The insert statement just tries to insert a BLOB into a table. I searched the ...
1
vote
0answers
1k views

Can the service-broker cause SQL Server to crash when using SQLDependency

I have C# application that uses SQLDependency to get updates from a message table. I have tested it quite extensively and worked great in the development environment but when I ran it on the ...
0
votes
0answers
5 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
78 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 ...
0
votes
0answers
15 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 ...
0
votes
0answers
60 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 ...
0
votes
2answers
56 views

How to group by linq based on input parameter?

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....
0
votes
0answers
28 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
35 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
81 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
29 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 ...
0
votes
0answers
89 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 ...
0
votes
1answer
34 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 ...
0
votes
1answer
163 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
4answers
133 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 ...
0
votes
1answer
57 views

Check for existing matches to find the field their grouped-by

So I have a table of values associated with different sessions using a field called sessionid, lets say the table has 3 other fields: itemcode, itemcost, & itemeffect. What I end up doing, is ...
0
votes
0answers
89 views

What is the difference between Microsoft SQL Server 2008 R2 and MySql Server 5.6 for handling Select ISNULL(MIN(StartDate, '1/1/1900 10:00'))?

I would like to know the difference between Microsoft SQL Server 2008 R2 and MySql Server 5.6 for parsing the following SQL statements. Microsoft SQL Server 2008 R2 SELECT ISNULL(MIN(StartDate),'1/1/...
0
votes
0answers
72 views

MySQL database hangs but less CPU

I create an application for 30 concurrent users using C# and InnoDB of MySQL (mysql-5.1.35). The size of database is more than 100M lines (~20GB). Most of data is come from 7 active table (2M lines/...
0
votes
1answer
29 views

Slow fill database

The source sends in my program a large number of rows. When the number of rows such as two thousand per minute for one table, all is saved in the database properly. But if you send two thousand per ...
0
votes
0answers
4k views

SQL Server pre-login handshake error

I am working on a system where sometimes request/sec increase up to 680. It's a .NET 4.0 web api. In normal situations when requests are fewer, everything is fine, but sometimes when the number goes ...
0
votes
0answers
584 views

Is it possible to restore only tables/constraints from database backup?

For circumstances beyond my control (permissions/bureaucracy), I'm unable to use SSIS or Scheduler Agent to create an automated, scheduled production database backup and development database restore. ...
0
votes
0answers
46 views

Correct way of saving information to a database

I am making a website where people can register/login and upload files (text only) and other people can view them. I have the file upload feature which upload the file to a folder and it automatically ...
0
votes
0answers
1k views

Transaction Time out error C#

Database Type : SQL server 2008 R2 Issue description: There are two machines. One is server machine(OS- Windows server Enterprise) another one is client machine(OS- Windows 7 professional). In Both ...
0
votes
0answers
405 views

ODBC--connection to 'SQL Server' failed

I am importing data from SQL server to MsAccess via query Insert INTO labels (linkage_index,label_name_index,label_value_index,label_line_number,extended_label) select linkage_index,label_name_index,...
0
votes
1answer
114 views

Database analysis

I have database which that store the sold products in Orders Table and another table called Transaction to set the time and the total price for the individual order ,my question is: How to combined ...
0
votes
1answer
2k views

ERROR: Failed to convert parameter value from a String to a DateTime

I have faced this error: Failed to convert parameter value from a String to a DateTime when trying to pass multiple selected dates from checkboxlist to my parameter to be used in sql. I have tried ...
-1
votes
2answers
588 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 ...
-1
votes
1answer
920 views

Using C# need to drop all tables in mySQL database beginning with prefix

I have found this question answered but not specifically for C#. The answer seems to be to execute the following statements tailored to my specific database. However, I can't figure out how to use ...