ado.net

Which control performs the type conversion:GridView or data source control?

Hello, Say we data bind GridView to an ObjectDataSource control and then perform a query. A) I realize displayed GridView fields are of type String, but does GridView also know of what type the underlying data source values are ( for particular GridView column )? * Thus, if data source will populate GridView with bunch of integers, th...

Fastest way to loop and copy data from one DataSet to another DataSet

I have one DataSet that contain 2 relate DataTable (master and details). I want to copy data that match my filter (e.g. master data column A = "XXX") to another DataSet. Now I found that this process take a very very long time. (about one hour for 1k records) I want to know how to improve this processing time? Thanks, Ek ...

How to have ADO.NET consume persisted XML ADO recordset for updates

I am working on a .NET 2.0 conversion of a multi-layer client-server application. For the time-being, we're converting the server-side to .NET but leaving client apps in COM (VB6). My current work is focused on getting data to/from the detached COM based clients. The current version under development is using ADO(COM) recordsets persis...

Transactionscope or IDbTransaction

EDIT: I am only accessing 1 database but a DTC transaction IS being created. I can see it in the DTC Transaction List GUI (Component services plugin). Why is this? I need to perform a transaction (several insert commands) against 1 database. Should I be using TransactionScope or IDbTransaction (connection.BeginTransaction)? Transacti...

Linq to Sql with ADO.Net Data Services

I am considering using ADO.Net Data Services in a project for the purpose of getting data over to a Silverlight client. I'd like to use the Data Services with my existing Linq To Sql classes and designer. I probably could regenerate everything as ADO.Net entity objects, but I feel this would be a bad design for DRY reasons. I'm new to...

ASP.NET login control and ADO.NET connection pooling

Using ASP.NET 2.0 SqlMembershipProvider with MSSQL 2005. To illustrate issue : 1) Create simple ASP.NET app with a System.Web.UI.WebControls.Login control on a page. Change Web.config to use forms authentication and System.Web.Security.SqlMembershipProvider. 2) Run web app in browser and login. Close browser. 3) Using some SQL too...

How can I create a simple class that is similiar to a datatable, but without the overhead?

I want to create a simple class that is similiar to a datatable, but without the overhead. So loading the object with a sqldatareader, and then return this custom datatable-like object that will give me access to the rows and columns like: myObject[rowID]["columnname"] How would you go about creating such an object? I don't want any...

Can you get the column names from a sqldatareader?

Hi, After connecting to the database, can I get the name of the all the columns that where returned in my sqldatareader? ...

Does a typed dataset use reflection at runtime?

Does a typed dataset use reflection on runtime? ...

How can i query for null values in entity framework?

I want to execute a query like this var result = from entry in table where entry.something == null select entry; and get an IS NULL generated. Edited: After the first two answers i feel the need to clarify that I'm using Entity Framework and not Linq to SQL. The object.Equals() method doe...

Complementing the entity in ADO.net Entity Data Model

(Playing around with the MVC framework) I have created a ADO.net Entity Data Model. Now I'd like to extend it with some business logic, like creating functions returning subsets of the context. A partial class is created together with the Data Model, so I created a new file declaring a partial class like this: I placed a function in it ...

GetDate() using Entity Framework

I am trying to use entity framework and get the date from the SQL server. The old way of doing this in LINQ is below but i'm needing something for the entity framework: Partial Public Class ActivityActionsDataContext <[Function](Name:="GetDate", IsComposable:=True)> _ Public Function GetSystemDate() As DateTime Dim mi As MethodInfo ...

Can Entity Framework connection strings reuse an existing connection string?

In my configuration files I have a connection string used by a legacy part of the app (using Datasets) and another string for Entity Framework: <connectionStrings> <add name="Database" connectionString="Server=..." /> <add name="Entities" connectionString="metadata=.....connection string='Server=..." /> </connectionStrings> Th...

Minimizing the memory footprint of an ADO.NET DataSet?

Given a legacy system that is making heavy use of DataSets and little or no possibility of replacing these with business objects or other, more efficient data structures: Are there any techniques for reducing the memory footprint of a DataSet? I am thinking about things like setting initial capacity (when known), removing restrictions,...

ADO.Net DataType of column of DataTable issue

Hello everyone, My question is how to assign the DataType value for columns of special SQL Types like, uniqueidentifier/nvarchar/datetime/varbinary(max) -- I did not find a mapping between .Net data type and such 4 types of SQL column data type? Here is a sample, which shows we need to assign the DataType (this sample maps .Net type to...

What is the best way to sort a data table in ADO.NET

What is the best for sorting a data table in c#, both from a performance and a code-readability point-of-view: personsDT.OrderBy(person => person.PersonName); or: personsDT.DefaultView.Sort = "PersonName ASC"; The personsDT is build from a SharePoint list, so it is impossible to use SQL (I am aware that an ORDER BY claude in a SQL ...

Need help with ADO.NET Entity Framework UpdateException.

I have in my Database a Contact table and a Phone table, in the phone table there is column "ContactId" with a key that references the phone to the contact. In the key options in the server I set its delete option to 'Cascade'. Now when I attempt to delete a contact using the context: Dim contact As Contact 'The contact I want to dele...

MetadataException: Unable to load the specified metadata resource

All of a sudden I keep getting a MetadataException on instantiating my generated ObjectContext class. The connectionstring in App.Config looks correct - hasn't changed since last it worked - and I've tried regenerating a new model (edmx-file) from the underlying database with no change. Anyone have any... ideas? Edit: I haven't changed...

IGNORE_DUP_KEY option in SQL Server

Hello everyone, I did quite some search in MSDN and Google, but looks like the description for IGNORE_DUP_KEY option is very limited. My confusions, Is IGNORE_DUP_KEY option an option for a column? for a table? for a couple of columns? for an index (making index unique)? If set IGNORE_DUP_KEY to Yes, when insert a batch of records (u...

Using Reflection and Collections to Illiterate a Object Rational Database

Hi All, Have C# question; I've been searching for a way to lets say dynamic created objects at runtime by iterating though them and there properties/methods. so far i've played with using Reflections and foreach to illiterate the class properties. This is to display all records in various tables on a Data Grid view. However one approac...