Questions tagged [system.data]

System.Data is a namespace of the .NET framework. It provides access to classes that represent the ADO.NET architecture.

System.Data is a namespace of the .NET framework. It provides access to classes that represent the ADO.NET architecture.

References

161 questions
5
votes
5 answers

The type or namespace name 'OracleClient' does not exist in the namespace 'System.Data'

When trying to run my code, I receive the following error: CS0234: The type or namespace name 'OracleClient' does not exist in the namespace 'System.Data' (are you missing an assembly reference?) I have included references to System.Data.dll and…
jaredk
  • 986
  • 5
  • 21
  • 37
4
votes
5 answers

Does Mono treat System.Data.SqlCommands differently to .NET?

I'm having some trouble with an application that we're porting to Mono. (For reference, the .NET runtime is 4.0, and the mono version is 2.6.7.) EDIT: This problem persists on Mono 2.10.2 As part of the startup of the application, it reads data into…
simple
  • 100
  • 9
4
votes
2 answers

DataColumn renaming to only change casing causes a weird behaviour

I found a weird behaviour (a bug?) in .NET Framework and .NET when it comes to DataColumn renaming. Here's how to reproduce it. Take a DataColumn in a DataTable Rename it so that you only change its casing Rename it again to something different Now…
dabon
  • 41
  • 3
4
votes
2 answers

Is there a built-in class in the .Net framework that can be used to denote an AnsiString?

For dapper I need to build support for passing in AnsiString params. Databases have both unicode and non-unicode strings, picking the right parameter type is sometimes crucial. DbType.String vs DbType.AnsiString for a particular param can heavily…
Sam Saffron
  • 128,308
  • 78
  • 326
  • 506
4
votes
2 answers

Fixing PlatformNotSupportedException when referencing System.Data.SqlClient from C# Azure Function

I am creating an Azure Function in C# using a target framework of netstandard2.0 in a Windows 10 environment. The function calls a method that's in another class library and that method creates an instance of SqlConnection. When I run the function I…
Paul Hunt
  • 3,395
  • 2
  • 24
  • 39
4
votes
2 answers

Correct way to use DbConnection, DbTransaction with connection pooling, transactionScope and dependency injection?

I have a Oracle database and I'm using the Oracle.ManagedDataAccess. In some cases I will need to do actions in a single transactions, but often not. I'm not sure what the best way to handle DbConnection objects within a single TransactionScope. I…
4
votes
2 answers

Querying DBF file with System.Data.Odbc.OdbcConnection when file path/name has space

I'm trying to query a DBF file using System.Data.Odbc.OdbcConnection. It works correctly when the file doesn't have a space in it, but I get the following error "Error opening DBF File: ERROR [42000][Microsoft][ODBC dBase Driver]Syntax error in FROM…
GnomeCubed
  • 594
  • 4
  • 14
4
votes
1 answer

Can I configure AutoMapper to read from custom column names when mapping from IDataReader?

Psuedo code for mapping configuration (as below) is not possible since the lambda only lets us access Type IDataReader, wheras when actually mapping, AutoMapper will reach into each "cell" of each IDataRecord while IDataReader.Read() == true: var…
rohancragg
  • 5,030
  • 5
  • 36
  • 47
4
votes
3 answers

Error with: using System.Data;

using System; using System.Data; using System.Data.SqlClient; ... I get the following error: The type or namespace name 'Data' does not exist in the namespace 'System' (are you missing an assembly reference?) I'm using Visual Studio 2013 Express…
Thematiq
  • 59
  • 1
  • 1
  • 3
4
votes
3 answers

Constraint on DataColumn in C# DataTable?

is it possible to create a value range constraint on a DataTable in C#? I'm dynamically adding a column to a DataTable: this.PrimaryCorrelationMatrix.Columns.Add(sName, typeof(int)); but I'd like all values within this Column to be integers from…
Rafael Emshoff
  • 2,541
  • 1
  • 35
  • 47
3
votes
0 answers

Out Of Memory Exception in PruneConnectionPoolGroups

We have a windows service that is throwing errors and shutting down with the following error: Failed to stop service. System.InvalidOperationException: An unhandled exception was detected ---> System.OutOfMemoryException: Exception of type…
john
  • 1,273
  • 3
  • 16
  • 41
3
votes
1 answer

Nested IF statements using DataColumn.Expression Property in .NET

I have a requirement where I'm required to use the DataColumn.Expression Property syntax (link provided below) to essentially run some pretty complex equations, including some polynomial equations that if I don't put in some mix/max limits on them…
wilbev
  • 5,391
  • 7
  • 28
  • 30
3
votes
1 answer

Getting value from field in DataTable when column name has spaces

I have tried: ObjDTOleDBNFeIntegra.Rows(I)("[Cnpj Cpf]").ToString() //with brackets ObjDTOleDBNFeIntegra.Rows(I)("'Cnpj Cpf'").ToString() //with apostrophe ObjDTOleDBNFeIntegra.Rows(I)("Cnpj Cpf").ToString() //without anything I'm using…
Marcelo
  • 3,371
  • 10
  • 45
  • 76
3
votes
3 answers

what is the difference DataView and DataRowView

I would like to know the difference between DataView and DataRowView. I looked up on MSDN and it says the DataRowView is just a customized representation of DataView. But can you also cast a DataView to DataRowView? Please explain Many thanks
doglin
  • 1,651
  • 4
  • 28
  • 38
3
votes
1 answer

Mono can't find System.Data.dll on Linux

I'm trying to compile the following example from here with dmcs (and gmcs... I tried both): using System; using System.Data; using Mono.Data.Sqlite; public class Example { static void Main() { string cs = "URI=file:test.db"; …
nerdenator
  • 1,265
  • 2
  • 18
  • 35
1
2
3
10 11