Questions tagged [ado.net]

ADO.Net is commonly used by programmers to access and modify data stored in relational database systems, though it can also access data in non-relational sources. It is a part of the base class library that is included with the Microsoft .NET Framework.

ADO.NET is a set of computer software components that programmers can use to access data and data services. It is a part of the base class library that is included with the Microsoft .NET Framework.

It is commonly used by programmers to access and modify data stored in relational database systems, though it can also access data in non-relational sources. ADO.NET is sometimes considered an evolution of ActiveX Data Objects (ADO) technology, but it was changed so extensively that it can be considered an entirely new product.

In modern practice, ADO.NET is often implemented along side the query language LINQ, and the Entity Framework (Microsoft's OR/M persistence layer).

10075 questions
3
votes
3 answers

How to check connection to DB without having the db its tables names

The point here is that I don't have the data base table names so please don't suggest to choose one table on to do on it 'SELECT COUNT(*)'
Erez
  • 6,405
  • 14
  • 70
  • 124
3
votes
2 answers

Is it possible to reload page Url without change request Url?

I have a page with a button that if clicked on it, a function is called that creates a pdf and it is opened in a new tab. Now after clicking this button, I want to reload the current page then pdf file open in a new window. How can I do this action…
negin motalebi
  • 351
  • 2
  • 15
3
votes
2 answers

C# program does not execute Stored Procedure

I want to run my Stored Procedure on an Azure SQL-Server from C# but it does not work and I do not know how to find out why. The stored procedure has two input parameters and based on these insert information into a table. So I can see in the table…
ruedi
  • 5,365
  • 15
  • 52
  • 88
3
votes
3 answers

In-place resequence of a primary-key column

I have a table with a composite primary key: table MyTable ( some_id smallint not null, order_seq smallint not null, --other columns ) ...where some_id and order_seq make up a composite primary key. The order_seq column is used to…
Justin Morgan - On strike
  • 30,035
  • 12
  • 80
  • 104
3
votes
1 answer

Is there an Entity Framework data provider for the Azure Blob Service?

I'm considering using WCF Data Services to implement a service exposing objects stored in the Azure Blob Service. I wonder if I could use a data model based on the Entity Framework. As I understand, I would need a data provider compatible with the…
Fernando Correia
  • 21,803
  • 13
  • 83
  • 116
3
votes
4 answers

Xamarin: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found

In Xamarin. I've been trying to make communications between my Web API and my Xamarin project. Here's the code for my controller: // GET api/values public List Get() { List values = new List(); …
Dadivitan Mj
  • 41
  • 1
  • 2
3
votes
5 answers

Must declare the scalar variable @param problem

Newbie alert! Error: Must declare the scalar variable "@param2". Must declare the scalar variable "@param2" (twice for two param2's) protected void Button1_Click(object sender, EventArgs e) { SqlDataSource ds1 = new…
Ranjanmano
  • 135
  • 1
  • 4
  • 14
3
votes
4 answers

A Powershell function to convert unix time to string?

I'm trying to read the date fields of Firefox places.sqlite datedase using ADO.NET and PowerShell. Obviously these fields are in Unix time. I'm looking for a conversion to .Net datetime or string Edit: I want to bind the datarow to a WPF…
bernd_k
  • 11,558
  • 7
  • 45
  • 64
3
votes
2 answers

DataTable: is deleting old DataRows before inserting new safe?

i have a many-to-many relationship table in a typed DataSet. For convenience on an update i'm deleting old relations before i'm adding the new(maybe the same as before). Now i wonder if this way is failsafe or if i should ensure only to delete which…
Tim Schmelter
  • 450,073
  • 74
  • 686
  • 939
3
votes
1 answer

Enterprise library 5.0 Close active connection forcefully

How can I close Database connection forcefully? The sample code I'm using to create connection is: class Customer{ private readonly Database _db; public Customer(){ _db = =…
Akhil
  • 1,421
  • 1
  • 16
  • 21
3
votes
3 answers

UnitOfWork vs Database connection

I currently have made a UnitOfWork implementation which wraps both the database connection and the transaction. using (var uow = UnitOfWorkFactory.Create()) { // do db operations here through repositories uow.SaveChanges(); } Rollback will…
jgauffin
  • 99,844
  • 45
  • 235
  • 372
3
votes
2 answers

ExecuteNonQuery is not working to create TempTable SQL Server

The temp table is not being created in the database. I verified that the credentials have access to create a temp table. Copy and pasted the SQL command and it works in SSMS. No exceptions are thrown when debugging. The cmd variable has the proper…
Ben V
  • 33
  • 3
3
votes
1 answer

Populate a table-valued parameter in ado.net with ONE insert statement for multiple values?

I have some C# code that is populating a TVP and then calling a stored procedure in SQL Server where it passes in that TVP. It utilizes the standard ADO.NET DataTable and the Rows.Add to populate the rows. When the sqlCommand.ExecuteNonQuery() runs,…
3
votes
1 answer

How do you unit test a DAL?

I have a Data Access Layer in my application which wraps an ADO.NET data provider. The DAL converts the data returned by the data provider into .NET objects. I've seen a lot of posts advising against unit testing the DAL, but it worries me that so…
sheikhjabootie
  • 7,308
  • 2
  • 35
  • 41
3
votes
0 answers

Is .Net Core much slower than .Net Framework in SQL connection?

Running code in .NET Core to connect to a SQL Server database seems much slower than in the full .NET Framework. Is this the case? Or I am doing something wrong? I have SQL Server 2017 on my PC and want to run a simple stored procedure like CREATE…
1 2 3
99
100