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

Questions tagged [ado.net]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
31
votes
6answers
22k views

Make SqlClient default to ARITHABORT ON

First things first: I'm using MS SQL Server 2008 with a database at compatibility level 80, and connecting to it with .Net's System.Data.SqlClient.SqlConnection. For performance reasons I've created ...
26
votes
3answers
12k views

What is the “Chaos” Isolation level and when should it be used?

ADO.NET documentation shows the possibility of setting the transaction level for a SQL transaction to Chaos. It sounds unpleasant, but if the feature is there, presumably it has some legitimate use. ...
24
votes
3answers
11k views

Why is `SELECT @@IDENTITY` returning a decimal?

I'm using Dapper to execute the following query against a SQL Server 2008 R2 Express instance from a ASP.NET MVC 3 (.NET 4.0) application. INSERT INTO Customers ( Type, Name, Address, ...
16
votes
2answers
6k views

Trouble deciphering a deadlock in an innodb status log

We are accessing MySQL from the Microsoft ADO.NET connector. Occasionally we are seeing the following deadlock in our innodb status and haven't been able to identify the cause of the problem. It ...
14
votes
1answer
7k views

Are we required to handle Transaction in C# Code as well as in stored procedure

Do we really require transaction handling in c# as well database store process both side C#: Using(transaction with transaction scope) { Execute stored proc; Transaction. Complete; } SQL ...
12
votes
2answers
6k views

Will these two queries result in a deadlock if executed in sequence?

This is almost certainly the cause of my other question, but I thought it was worth separating the two as I have a hypothesis based on the following log that I would love to have falsified or verified....
10
votes
1answer
393 views

What are the ramifications of setting ARITHABORT ON for all connections in SQL Server?

So I've determined that the erratic behavior of my SQL Server is because of .Net SqlClient Data Provider's default setting of SET ARITHABORT OFF. With that said, I've read various articles that debate ...
8
votes
2answers
486 views

How can I get individual rowcounts like SSMS?

I have a client c# program that is executing stored procedures via ExectueNonQuery, including catching the PRINT and Error output with InfoMessage events. It works fine, but I have noticed something ...
7
votes
1answer
294 views

.NET executes a SQL query and Active Monitor shows multiple rows blocking each other

I use .NET to execute SQL operations on SQL Server 2014, here's the code used: using(SqlConnection conn = new SqlConnection(connectionString)){ //https://stackoverflow.com/questions/1880471/...
7
votes
1answer
4k views

Perform reads and writes in the same transaction

I'm trying to implement transactions in my application. I'm just trying to implement it like the example shown in the BeginTransaction() documentation. Public Shared Sub Process(wwid As String, ...
6
votes
3answers
2k views

Is the ADO.NET Entity Framework known for generating poorly performing queries?

This question is inspired by the comment posted to the latest ServerFault blog post: Are you guys still using LINQ to SQL? I know I can use SQL Server Profiler and/or the ToTraceString method to ...
6
votes
1answer
841 views

Is there an upper limit to the SqlDbType.Structured ADO.NET type?

Is there an upper limit to the number of rows\total size of the SqlDbType.Structured type when sending data to a Table parameter in a sproc? I can't find anything to suggest there is so I'm assuming ...
6
votes
1answer
11k views

Are there other ways to select a dynamic list of columns?

I need to let my users specify the list of columns they want to select. So far I know two ways of accomplishing that. 1. Using refcursors CREATE OR REPLACE FUNCTION selecttestwithcolumnlist( ticker ...
5
votes
1answer
7k views

SQL server temp table using # - is it only accessible by the containing query for multiple connections with the same login?

Say we have 2 completely different queries, that reference a temp table with the same name: query one ....operates on: #tempTableName query two ....operates on: #tempTableName I've ...
5
votes
2answers
2k views

How to track SSIS memory and CPU performance?

I may be missing some pieces to this puzzle, but this is what I have: All of this was written for us by an outside firm. There is a .Net application that runs as a service on Server A. Inside that ...
4
votes
2answers
35k views

Currently all connections getting “Timeout expired”

I have an application which connects to SQL Server. Currently I am getting, Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because ...
4
votes
2answers
6k views

How can I catch the output of DBMS_OUTPUT.PUT_LINE when executing a block using [Oracle.DataAccess.Client]?

In my oracle Database if have the following table: Create table Test_call_count ( count number(10) ); insert into Test_call_count values (0); Now I can run the following PowerShell script if ($...
4
votes
1answer
3k views

SSIS mySQL ADO.NET connection string

I want to make my SSIS project can be configure through project parameters. So I use project parameters to store connection strings. But the connection string which I copied from the mysql connection ...
3
votes
3answers
1k 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 ...
3
votes
2answers
119 views

Sql server sleeping state is increasing using ADO.NET?

We have one live ASP.Net application which is used by around 1000 concurrent users. In this application we have used connection pooling. There are 2 connection string defined in web.config with ...
3
votes
1answer
287 views

SSMS returns results immediately; ADO takes longer

I am running a query that returns ~250k results. It is basically SELECT * FROM my_schema.my_view (and the view is somewhat complex, and all table references in it are two-part) I am not passing any ...
3
votes
1answer
135 views

sp_primary_keys_rowset is consuming a lot of CPU

I manage a database server that supports a C#/VB.NET application and we've had a lot of CPU usage problems. I am using the following dmv query from Glenn Berry at SQLSkills: SELECT TOP(50) DB_NAME(t....
3
votes
0answers
793 views

Personal Finance database review

G'Day, I found that someone had started on this topic on personal finance, I like to go further using a good personal finance plan I found on the internet which I would model. In advance please ...
2
votes
2answers
442 views

SqlDataAdapter vs SqlDataReader for DBAs

Speaking to developers about the use of SqlDataAdapter vs SqlDataReader and reading this: https://stackoverflow.com/questions/1676753/sqldataadapter-vs-sqldatareader Yields little in the way of ...
2
votes
3answers
2k views

SSIS 2008 painfully slow to import CSV

I am using SSIS to import a 25,000 row CSV to an empty table. The table has a primary key that is populated as the data is inserted. I am using an ADO.Net destination. What reasons are there why ...
2
votes
1answer
282 views

How can I connect to a database after its disk has come back online?

I have problems with database after reconnecting a hard disk: .Net application works with database. Disconnect hard disk with physical files. Make any request to the database (of course we will have ...
2
votes
1answer
2k views

What is the purpose of sqlbulkcopy's useinternaltransaction property?

I'm just testing my PowerShellScript to do bulkcopy of multiple tables between sql-server and oracle Databases. When the destination is Oracle, than I can monitor the progress by by executing select ...
1
vote
2answers
9k views

Stored procedure big where clause or multiple procedures

Is it better to have one big query or N small ones? For example to select all the customers with multiple parameters: select id, name, firstname, city, birthday, ... from dbo....
1
vote
2answers
2k views

Getting the metadata about a Query and a Stored procedure in SQL Server

I would like to get all the names of the columns in a given query [SQL Textual Query] and also the columns that are in the SELECT clause in a Stored Procedure. Is there any ways other than using ...
1
vote
1answer
66 views

MSSQL - Query efficiency to many filters

I'm making an ASP.NET website which users can select more than 20 different filters at the same time. Something like 'Product Type', 'Year', 'State-of-Usage', 'Color', 'Size' and so forth. Many of ...
1
vote
1answer
43 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
65 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 ...
1
vote
2answers
3k views

Query timeout expired error on SQL Server via ASP page

I am getting the error [Microsoft][Sql Server Native Client 11.0] Query timeout expired on SQL Server via ASP page. Most of the time it is working fine but sometimes I am getting this error. Can ...
1
vote
2answers
602 views

Oracle connection through visual studio

I installed oracle client 11.2.0 version in my machine and also installed Oracle data access providers for visual studio.I also installed Oracle Data Access 11.2.0.3.20. I am trying to connect to the ...
1
vote
1answer
67 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 ...
1
vote
1answer
87 views

Is there a public repo where I can contribute to the MySQL .NET connector?

We have found ourselves making some performance and scale improvements for the MySQL .NET driver from here http://dev.mysql.com/downloads/connector/net/ We know where to get the source in a ZIP ...
1
vote
1answer
86 views

OLE DB provider for ADO.NET data source

I have an application which can connect to OLE DB data sources. But me proprietary database has only ADO.NET provider. Is there any ADO.NET to OLE DB bridge which helps me to connect to ADO.NET data ...
1
vote
0answers
1k views

SQL query to return a column per date in date range with sum of contract utilisations (value/duration)

My question is similar but more elaborate than another already in stackexchange.com "SQL query to return a column per date in date range?" I have the following data: Customer Start_date ...
1
vote
2answers
1k views

Run Multiple Scripts In One Transaction Across Multiple Servers [duplicate]

We have deployment scripts that we need to run on databases that are spread across multiple servers. One script only runs on one database, but the scripts depend on each other. We are looking for a ...
0
votes
1answer
695 views

Use serial ID for multiple columns and return it from INSERT

I am using Npgsql and I want to be able to do an insert, and if statement that will do an update and then return a value so when ExecuteScalar is called it reads that value. This was done fine in ...
0
votes
1answer
209 views

Large Table Times out - Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding

We have a customer who is experiencing Time-outs in our .NET application which uses SQL Server as the backend. The table in question is the OrderLines table in a SQL Server Database that has 4155151 ...
0
votes
1answer
873 views

Creating a bar chart from datatable

I'm writing a console application that fetches data from database (SQL) and writes to an excel sheet. Now I want to add a chart in the workbook according to the datatable values. How can I create ...
0
votes
1answer
502 views

What is the relationship between ADO.NET and Npgsql?

There is a sentence in the Npgsql official page: Npgsql is an open source ADO.NET Data Provider for PostgreSQL. I know that I can access a Postgresql database using Npgsql with the .NET framework. ...
0
votes
1answer
805 views

Create a User and Password for ADO.net and SQL SERVER Authentication

I am trying to create a sample application in asp .net mvc with sql server authentication. I want to create a user with password in sql server so that i can provide it in connection string in asp ....
0
votes
1answer
293 views

SQL Blocking causing timeouts

We have a long running transaction (with nested trans), it runs for about 2min. In this time it does a heap of insert, update and selects. At the same time users still need to be able to use the ...
0
votes
2answers
194 views

Understanding the use of Sql command parameters

I am using MySql database and I have a stored procedure to insert data, like this- CREATE DEFINER=`root`@`localhost` PROCEDURE `adduser`( IN id varchar(10), IN pwd varchar(10), IN fname ...
0
votes
1answer
2k views

32-bit versus 64-bit ODP.NET to Oracle connection

I seem to be having an issue connecting a 32-bit .NET application to a 64-bit server, without a full Oracle client. If I build a 64-bit application, using the 64-bit ODP.NET dll's or a 64-bit instant ...
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
17 views

Does MySQL support ED22519 certificates for SSL?

I'm trying to set up SSL for a public MySQL server with both server and client-side certificate verification. The server is a MySQL 8.0 instance and the client is Connector/NET (other .NET connectors ...
0
votes
1answer
40 views

How can I setup and use a PostgreSQL database without installing a driver?

I have a portable PostgreSQL database that runs perfectly on my computer as a database server. This is a work computer that I use for a lot of work in Excel with non-sensitive data (that is, data that ...