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
2
votes
1 answer

Uploading DataTable to Azure blob storage

I am trying to serialize a DataTable to XML and then upload it to Azure blob storage. The below code works, but seems clunky and memory hungry. Is there a better way to do this? I'm especially referring to the fact that I am dumping a memory stream…
Tom Ferguson
  • 907
  • 1
  • 10
  • 26
2
votes
0 answers

Enumerating DbProviderFactories in MS Enterprise Library returns different results

I have multiple applications that use MS Enterprise Library and the Oracle ODP.Net drivers to connect to Oracle. One application, a windows service, throws the following error when trying to create a connection to the Oracle DB: The connection…
jeff.eynon
  • 1,296
  • 3
  • 11
  • 29
2
votes
1 answer

C# Why isn't there an implicit cast from SqlDbType to DbType?

I have boil it down to a simple example: using System; using System.Data; class MyProgram { void DoStuff(DbType t) { } public MyProgram() { DoStuff(SqlDbType.Int); } } class Program { public static void…
Alex
  • 2,247
  • 1
  • 27
  • 37
2
votes
2 answers

C# "painless" way to call stored procedures with parameters?

I'm looking for the absolute easiest way to call stored procedures from C# without explicit parameter objects, like so: using (DataTable dt=conn.ExecuteQuery("MySP", param1, "param2", p3, p4)) { On first invocation the library queries the DB…
2
votes
1 answer

Windows CE and Oracle

I am using VS2005 and I have a project to build an application for Windows CE 5 which make a connection to an Oracle Database (11g). Here is my code : OracleConnection oConnexion = null; OracleCommand cmd = null; …
Mikael
  • 91
  • 7
2
votes
1 answer

Log4net dependency on System.Data.dll when using AdoNetAppender

We have set up log4net within our current project to use the AdoNetAppender to write log entries to a SQL Server database. This all works correctly, but for some reason in order to get it working we have to set Copy Local to true on System.Data.dll…
Henry Wilson
  • 3,281
  • 4
  • 31
  • 46
2
votes
2 answers

Use of existing framework ConstraintException for data constraint violations

I have a standalone application that does data checking of flat files before they are imported into a SQL database. In a context like this, does it make sense to throw a System.Data.ConstraintException? (The example is…
neontapir
  • 4,698
  • 3
  • 37
  • 52
2
votes
0 answers

Using System.Data.SqlConnection in mono, Second invalid login attempt results in "object reference not set to instance of an object"

Using mono's System.Data.SqlConnection to try to establish a new connection (via prompt to user for username and password), if the user enters the wrong username more than once i get an exception: "object reference not set to instance of an object"…
1
vote
0 answers

System.Data.DataView.Find method: substring starts-with not possible?

Is it possible to use the Find() method of the DataView object to return the index of a row where the column used in the default sort starts with a particular string? I've been trying various permutations and the only one that seems to work is an…
Tim
  • 8,669
  • 31
  • 105
  • 183
1
vote
1 answer

DataGridView BindingDataSource with a Foreign Key

I have a DataGridView that is bound to a BindingList of a custom business object, with fields DeckID, Name, UserID, Size, and Notes. This is being called up from an MSSQL database via an IDataReader object. Now, my problem is that UserID is an…
Jack
  • 950
  • 2
  • 17
  • 36
1
vote
3 answers

Int64 throws "Number overflow" using SQLite

I've created an SQLite database (in windows) with a Int64 column. I copied the database to my MonoTouch program. When I try to read the column in MonoTouch (Mono.Data.Sqlite), it throws a "Number overflow"... System.OverflowException: Number…
MojoDK
  • 4,410
  • 10
  • 42
  • 80
1
vote
1 answer

MonoTouch: Can't create DbParameterCollection?

I'm a vb.net guy trying to figure out MonoTouch c#. I made this data helper: public static void ExecuteCommand (SqliteConnection cnn, string command, System.Data.Common.DbParameterCollection parameters) { using (var c = cnn.CreateCommand()) { …
MojoDK
  • 4,410
  • 10
  • 42
  • 80
1
vote
2 answers

Why is my comparison to null, of a value contained in a System.Data.DataRow object, failing?

I am converting an app's database from Access to MS SQL Server and encountered a problem with a line of code that checks to see if an item retrieved from the database is null. It essentially looks like this: if (System.Data.DataRow["foo"] ==…
raven
  • 18,004
  • 16
  • 81
  • 112
1
vote
1 answer

SqlGeography does not implement IComparable interface, preventing DataSet.RejectChanges() from succeeding

I'm working on an Enterprise application that has an SQL backend, and uses System.Data.DataSet etc to represent that data in C#. Previously we turned the SqlGeography into DbGeography before putting it in our DataTables, and everything worked, until…
Patashu
  • 21,443
  • 3
  • 45
  • 53
1
vote
1 answer

Mango and System.Data

I've been experimenting with Mango's new data libraries (System.Data.Linq) but I've never used Linq to SQL before and all of my existing code is written for SQLite with ADO.NET. Is there any way (via referencing a Silverlight DLL or otherwise, that…
Echilon
  • 10,064
  • 33
  • 131
  • 217