Affected Rows Entity Framework
How do I get the number of rows affected after a SaveChanges()? ...
How do I get the number of rows affected after a SaveChanges()? ...
I have been using Asynchronous operations in my WinForms client since the beginning, but only for some operations. When the ExecuteReader or the ExecuteNonQuery completes, the callback delegate fires and everything works just fine. I've basically got two issues: 1) What is the best structure for dealing with this in a real-life system...
I am trying to insert huge amount of data into SQL server. My destination table has an unique index called "Hash". I would like to replace my SqlDataAdapter implementation with SqlBulkCopy. In SqlDataAapter there is a property called "ContinueUpdateOnError", when set to true adapter.Update(table) will insert all the rows possible and ...
I have a store procedure like this: CREATE PROCEDURE up_action (@id int ,@group varchar(30)='' ,@nom varchar(30)='' ,@compte varchar(30)=NULL ) AS BEGIN DECLARE @chrono int ...... select @date=date from users where compte=@compte INSERT INTO dialog (numappel,auteur,commentaire,etape,etapews,operant) VALUES (@numappel,@nomprenom,@dialog...
I'm working on a SharePoint workflow, and the first step requires me to open an Excel workbook and read two things: a range of categories (from a range named, conveniently enough, Categories) and a category index (in the named range CategoryIndex). Categories is a list of roughly 100 cells, and CategoryIndex is a single cell. I'm using ...
I there, I'm building an application that uses Sync Services for ado.net but as a requirement, my ServerSyncProvider can't have direct access to the database, instead, only business entities can. I'm thinking about building a custom ServerSyncProvider. Any tips on that? thanks ...
I was surprised to find a public letter proposing a vote of no confidence in the entity framework (see http://efvote.wufoo.com/forms/ado-net-entity-framework-vote-of-no-confidence/) Would the reasons stated in the letter keep you from using the current version of the entity framework? Would you rather wait for v4.0? Or rather use anothe...
I rehydrate my business objects by collecting data from multiple tables, e.g., SELECT * FROM CaDataTable; SELECT * FROM NyDataTable; SELECT * FROM WaDataTable; and so on... (C# 3.5, SQL Server 2005) I have been using batches: void BatchReader() { string sql = "Select * From CaDataTable" + "Sel...
I am using Xceed's Datagrid, bound to a dataset. I want to update the database when the datagrid's RowEditEnd is called. The problem is that in order to avoid concurrency violations when updating, I have to clear the dataset after update and refill it, like this: public void UpdateDatabaseFromDataSet() { adapter.Update(exampleDataSe...
Do constraints on a DataTable (e.g. PrimaryKey & UniqueContraint) make Selects more efficient in the same way that they would in SQL Server? Or is their only purpose to enforce rules on the data? myDT.Constraints.Add("PK", myDT.Columns["UniqueID"], true); //add a primary key myDT.Constrinats.Add(new UniqueConstraint(new DataColumn[] { /...
How do I compare values of one data set from another. 1st dataset["proper records"](coming from sqlserver, with column name [id],[subsNumber]), 2nd dataset["proper and inproper records"](coming from progress database, with diffrent coulums except 1 which is[subsNumber]). how do I go and make another dataset which has all the [subsNumbe...
I have an ASP.NET Project. I am connecting to the DB and then closing and disposing of the connection object. But when anyone enters my site, MS Access creates a temporary dbname.ldb. When I want to download my original mdb file from my server it won't let me access the mdb file. I can't do anything if there is ldb file in server. It's l...
Hi all, We need the application we are building to be Database-agnostic. In particular, I need it to be able work with SQL Server, Oracle and MySQL. In the future, possibly other DB Vendors will be added to the list. Of course, whatever DB is to be used will have the same schema. In order to build a prototype to demonstrate the interfa...
Hi i want to add a datarow that im getting back from a data table to a new datatable this is the code im using: foreach (DataRow dr1 in dt.Rows) { string AptType = dr1["AppointmentType"].ToString(); if (AptType == "FreeTime") { dt2.ImportRow(dr1); } } RadGrid2.DataSource = dt2; reader.Close(); conn.Close(); the problem i...
We have a database with ~100K business objects in it. Each object has about 40 properties which are stored amongst 15 tables. I have to get these objects, perform some transforms on them and then write them to a different database (with the same schema.) This is ADO.Net 3.5, SQL Server 2005. We have a library method to write a single pr...
I'm experimenting some difficulties trying to use Connection String Builders (ADO.NET) within LINQ to SQL. Let me show you guys what I'm trying to do: the app.config file: <?xml version="1.0" encoding="utf-8" ?> <configuration> <configSections> </configSections> <connectionStrings> <add name="LoremIpsum" ...
Hi! I'm new to ADO.NET so asking for help. I have to insert large number of records in one table. What is best-practice, effective and easy way to do that? I found an article called Batch Requests (ADO.NET Data Services Framework) but it isn't clear for me. Also I found an article about BULK INSERT but such method uses external file, I...
Hello everyone, I have a table structure like (OrderID [uniqueidentifier], OrderDesciption [nvarchar]), I am using ADO.Net + C# + VSTS 2008 + SQL Server 2008. The table is big, and I want to let client give me two inputs, begin range index and end range index, and I will return specific rows of the table which is in the range (between b...
I'm trying to batch insert data into SQL 2008 using SqlBulkCopy. Here is my table: IF OBJECT_ID(N'statement', N'U') IS NOT NULL DROP TABLE [statement] GO CREATE TABLE [statement]( [ID] INT IDENTITY(1, 1) NOT NULL, [date] DATE NOT NULL DEFAULT GETDATE(), [amount] DECIMAL(14,2) NOT NULL, CONSTRAINT [PK_statement] PRIMARY KEY CLUSTE...
Preamble: So, over the past 5 years or so various applications and tools have been written here at my company. Unfortunately many of the people who developed these applications used strongly typed datasets, I'm considering outlawing them in our shop now... One of the larger processes that used strongly typed datasets is now timing out...