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

learn more… | top users | synonyms

3
votes
0answers
31 views

How to deal with Users Needing to Enter Mixed Data Types in MS SQL Server

I have a form in a C# application that I can't change with a data table bound to a query. The user enters a mark for a student's task or 'A' for absent. However, the person who designed this had the ...
0
votes
1answer
24 views

Could I set my InnoDB MySQL Server session state for SQL_SAFE_UPDATES and INNODB_FLUSH_LOG_AT_TRX_COMMIT?

Could I set my InnoDB MySQL Server session state for SQL_SAFE_UPDATES and INNODB_FLUSH_LOG_AT_TRX_COMMIT using MySQL Workbench's SQL Query window or MySQL Connection Navigator instead of in a c# ...
1
vote
0answers
9 views

MongoDB too many db.eval cause my DB can't read write

I am using C# Web API with mongocsharpdriver 1.9.2 and MongoDB 2.6.9 In my case I need performance that have to use db.eval to execute JavaScript on the server side. But I got a problem that too ...
0
votes
1answer
32 views

Database role to allow .NET program to retrieve MSDB table and view rows

I'm currently writing a database management application that connects to all of my databases and returns metadata for each database. The user currently has db_datareader role for MSDB but the ...
2
votes
1answer
37 views

SQLCLR assembly throws error when multiple queries run simultaneously

I have been using SimMetrics to implement the QGramsDistance search in SQL Server. The SimMetrics is used as a SQL CLR assembly. The search results are promising and everything was well, until of ...
0
votes
3answers
59 views

How to copy data from one database to another database efficiently?

I have a conceptual question. I have two databases which theoretically have the same structure but one of them is a SQLBase database and the other one is a SQL Server database. One database (the ...
2
votes
1answer
35 views

SMO Copy database or remove all non-system database objects

I have c# SMO script which copy all database objects to existed empty database or to a new database. But this approach has two problems Existed database is not empty, manual intervention is needed. ...
6
votes
2answers
78 views

SQL server Database statistics degrading after execution

I have been experiencing timeouts while querying my SQL Server DB in particular one table. I tried updating the statistics and it fixed the performance issues for a couple of days. I started digging ...
-3
votes
1answer
69 views

Unable to connect to SQL server 2008 R2 via computer name [closed]

I wrote a program, on my computer it works correctly because SQL Server us running on my computer, but another computer in the network can't use the database. Here is the definition of the connection ...
4
votes
2answers
37 views

Timeout expired SqlException for complex Procedure

I use Sql Server 2008 R2 and ASP.NET 4.5. Sometimes, I get this error when I executed a complex procedure: System.Data.SqlClient.SqlException Timeout expired. The timeout period elapsed ...
1
vote
0answers
59 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 ...
-4
votes
1answer
139 views

Entity Framework C#: Get rows between two dates [closed]

I have an SQL server database with a column named "Time" of format "datetime". In C# Entity Framework, I want to get all rows whose date is after 8am of today: using (var db = new ...
0
votes
1answer
43 views

How can I optimize my SQL Query (Multiple Rounds)

I'm try to round the sum of every month for the current und and last year. But with thousands of entries this query is slow. How can I optimize it? I want to use the results in a C# Application. The ...
0
votes
0answers
168 views

Execute Multiple Queries in a single transaction using Npgsql - C#

I have a Web System using C#.NET + NancyFX and PostgreSQL as my database, and in some functions I have to make insertion in more than one table. For example just to make it clear: I have two tables: ...
0
votes
0answers
58 views

Database design for storing historical stock exchange Level2 (depth) data

I am developing C# software using embbeded SQLite Database which shows historical level2 (market depth - asks/bids) stock exchange data graph. Example Simply speaking, there are 25 asks (price, ...
0
votes
1answer
85 views

Derived classes with same base class and class specific ids

I have three classes in my project. One base class and two derived classes. public class Animal { public long Id { get; set; } public DateTime Created { get; set; } public string Name { ...
0
votes
0answers
41 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 ...
1
vote
1answer
69 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 ...
0
votes
0answers
33 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 ...
-2
votes
1answer
75 views

Why are writes failing in MongoDB?

Here is the information about my development environment: Microsoft Visual Studio Community 2015 .NET Framework 4.6 ASP.NET MVC assembly System.Web.Mvc Version=5.2.3.0 MongoDB.Driver 2.0.1.27 ...
0
votes
0answers
156 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 ...
0
votes
1answer
107 views

Convert C# logic/lambda's to T-SQL

I am trying to convert the following logic in C# to a SQL Server stored procedure: C# logic // Filter by the search term if the first OR last name is null or empty // || is an 'OR' operator that ...
0
votes
1answer
132 views

How to setup sync between MongoDB and C# .NET Application

What is the best practice to synchronize a MongoDB remote database with a C# .NET App that would allow queries to be responded to within the local file system and update itself when there is a change ...
1
vote
0answers
799 views

“[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied” after installing SQL Management Studio?

I recently installed SQL Management Studio (which also installed SQL server 2016 to my local machine), and now am unable to connect to SQL server from applications on my machine. It will come up with ...
0
votes
1answer
69 views

Database structure for object with dynamic attributes

I am developing a proof of concept for a personalized email sending web application (like MailChimp, but with premade dynamic templates). The general structure is that I have my templates (different ...
0
votes
0answers
58 views

Can we swap out SQL Server with HBase on our .Net application?

In a current application we use SQL Server. The data flow consists of using TVPs for better-than-bulk-insert performance by passing in DataTables. As part of the data addition process, old records ...
2
votes
1answer
263 views

SQL Server : create dynamically queries to select all related data in DB based on entry table and ID

I'm tasked to create a SQL statement which will create (and run?) multiple other queries which will select all related data outgoing from an given ID (uniqueidentifier) and a given table name. It ...
0
votes
3answers
330 views

SSIS - Best way to insert large number of rows

So here's the scenario: I have an XML file, which is in size of 500GB, and with data of around 600 million rows (once on a database table). I'm using SSIS for the operation, and since it consumes a ...
2
votes
1answer
344 views

Select columns dynamically from sql server table

Lets say I have a table that actually store record which looks like Create Table dbo.Info ( SN int primary key identity(1,1), FirstName nvarchar(50) not null, LastName nvarchar(50) not null, ...
0
votes
1answer
17 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 ...
5
votes
1answer
275 views

Can CLR execution continue after 'THROW' is encountered in T-SQL?

I am calling a T-SQL stored procedure from a CLR stored procedure. and the THROW statement in T-SQL stops the execution of CLR without going into the catch block. Is there something I can change in my ...
2
votes
2answers
66 views

CLR/C# equivalent to XACT_STATE()

I am porting a set of T-SQL stored procedures to C#/CLR. In the T-SQL, we use XACT_STATE() to determine if an error requires rolling back to a savepoint or rolling back the transaction entirely. I ...
0
votes
2answers
209 views

Grant execute on xp_logevent to sa using sa user to do it

Running a SQL Server 2012 CLR stored procedure with this code: const string executeLog = "EXEC master..xp_logevent @errorNumber, @message, informational"; using (SqlCommand cmd = new ...
2
votes
2answers
573 views

Sync many client database to one central database

We have client application which can be installed on local machine where users can work offline and create projects in it. This application is already developed. Now we need to create Admin ...
0
votes
0answers
34 views

Passing DataTable using SqlBulkCopy

Should I convert the DataType of DataColumns in to pass DataTable using SqlBulkCopy? This are the fields in my sql server database
0
votes
1answer
175 views

Log debug messages in a SQL CLR C# Stored Procedure

I have developed a SQL CLR stored procedure in C#, for SQL Server 2012. I want to log messages to SQL Server registers. On a normal stored procedure I use xp_logevent What can I use to log a message ...
2
votes
0answers
85 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. ...
8
votes
3answers
2k views

How to insert a large amount of records to the database in a short time?

I have to insert a bunch of records(500,000) to the database at once, using the fastest way. I've tried inserting 1,700 records at once but it took twenty minutes!! I am using SQL-SERVER, and C#. ...
0
votes
0answers
13 views

Pat_ID Incrementing by 2 only after close

I am working on an internal project connecting my database to my application. I am using C# to write the program. I am still learning and this is more of a training tool than anything else. When the ...
1
vote
0answers
44 views

Statement succeeds, data missing [closed]

I have two reports from the same customer, where they claim that an error occurred that implies a SQL Statement didn't execute. These are very simple statements, setting a value in a single column. I ...
1
vote
2answers
788 views

Naming The SSRS Report Name based on the Parameters Passed

I want to save my SSRS Report Based on the Parameters Passed. i.e. Am passing P1 And P2 as parameters so I want my SSRS Report name as P1_P2_ReportName.Xtension. Any suggestions?
0
votes
1answer
346 views

Put Postgres query result in array

How can I put an sql query result in a string array with Postgres? I have some attributes in the column 'zone' of the table 'mytable' and I must put them all in a String[] areas; This is my first ...
0
votes
0answers
814 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 ...
1
vote
2answers
392 views

Dropping person while their connection sleeping in SQL Server

I have a C# application that communicates with SQL Server. When I try to drop a user that recently had a connection with SQL Server, it gives me an error that I can't delete them because they have ...
0
votes
0answers
16 views

Find unpublished columns via RMO

The stored procedure sp_helpmergearticlecolumn will return all columns for a table and have a bit set if the column is published or not. The MergeArticle RMO object has the function ...
0
votes
1answer
465 views

MySQL Data Synchronisation from different Databases in C#

I am supposed to create a C# solution to compare the data (table, column and row) from two different databases and update the 2nd one as follows: 1. with just the rows that are updated recently ...
1
vote
2answers
1k views

How to re-declare T-SQL variables if it already exist?

Background: I'm building a SQL command to be executed on the server which involves a lot of accessing store procedure and declaring variables which are used as input to other stored procedures. This ...
2
votes
2answers
207 views

How to handle too many inserts?

I have a database that is accessed from remote locations in the world with very long delays and poor transfer speeds. I currently transfer the data using a transaction since either all or no data ...
3
votes
1answer
231 views

I can backup my SQL Server 2008 R2 but can't restore from the very same folder

I ran a backup into a folder. The Network Service has full control access to this folder. The backup process didn't work until I granted that account full control. I try to restore that same file but ...
1
vote
3answers
789 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 ...