Tag: ado.net

SqlDataReader.GetValue Hangs

I run a process built in C# .Net 4.6.1 that accesses a SQL Server database. The process runs on Windows Server 2012 R2 Standard. The SQL Server database is on another server with SQL Server version 11.0.6567.0 The process executes the following code: 01 var readStatement = ‚Äúselect * from TableA order by ColumnX,ColumnY, ColumnZ […]

Bulk Copying and Deleting in OneTransaction

In C# application I like to copy the table data from one server(SQLServer2000) to another server (SQLServer2005). I like to copy the data in single instance and delete the existing data in the SQL Server 2000 table. I need to do all this(Bulk copying and Deleting) in single transaction. How to achieve this? Note: I […]

using sql server 2005 synonyms for table causes dynamic query generation errors

I have a situation where by i have a catalog on Server A, and a same named Catalog on Server B. I’m using synonyms on Server B so that some tables are actually just going through to server A. Such that, calling select * from ServerB.Table, is actually returning Data from ServerA.Table transparently. This seems […]

Dataset Acceptchanges in SQL Server

I am loading my ADO.net dataset in by select query in command object. If I clear the dataset data with Acceptchanges will it delete the data in the sql server. If not Please let me Know how to do?

ADO.NET Query optimisation

I have a bit of a strange one happening. The first query I got from running a profiler on a C# ADO.NET application. What it is doing is not as interesting as the way the parameters are being passed – This query is taking 250+ seconds to complete, but when I modify it (Query 1) […]

SqlParameter Size – negative effects of setting to max size?

I have a SqlCommand that I want to call Prepare() on whose CommandType = Text (it cannot be a stored procedure). In order to do this, I need to set the Size attribute on the parameters to be non-zero otherwise an exception is thrown. Are there any negative effects from setting the Size on all […]

Conversion failed: SqlParameter and DateTime

I’m changing old, vulnerable SqlCommands with SqlParameters but get a SqlException: System.Data.SqlClient.SqlException {“Conversion failed when converting datetime from character string.”} on sqlCommand.ExecuteScalar: Dim sqlString As String = _ “SELECT TOP 1 ” & _ “fiSL ” & _ “FROM ” & _ “tabData AS D ” & _ “WHERE ” & _ “D.SSN_Number = ‘@SSN_Number’ […]

sp_helptext output being dropped by ADO.NET?

I’m using the tool described here to clean up some cruft from our development DBs. I’ve encountered an odd issue with it and can’t find the cause. For certain stored procedures, the GetProcedureText method (l:47, Validator.cs) fails to return the proc text, causing the program to behave unexpectedly. When debugging and stepping into GetProcedureText it […]

Single Query returning me 4 tables, How to get all of them back into dataset?

How to fill multiple tables in a dataset. I m using a query that returns me four tables. At the frontend I am trying to fill all the four resultant table into dataset. Here is my Query. Query is not complete. But it is just a refrence for my Ques Select * from tblxyz compute […]

Have XML file need it to populatemultiple SQL Tables

I have a XML file that I need to populate multiple SQL tables, and I was wondering what the best way to do that is. I was thinking dataset, or xslt but I honestly not sure. Here is my generated XML (part of it) <?xml version=”1.0″ encoding=”utf-8″ standalone=”yes” ?> – <!– Created: 8/3/2010 12:09:15 PM […]

MS SQL Server is a Microsoft SQL Database product, include sql server standard, sql server management studio, sql server express and so on.