ado.net

Entity framework 4 or DataSet ?

For a basic ERP (DB with around 150 tables, WinForm app) which would run on a classic LAN network (1 server and up to 25 clients) would you recomend EF4 or DataSet ? LINQ2SQL is NOT an option ! ...

ADO.Net Data Services Update

I'm finding that my svc I've created to use the latest paging update from the ADO.NET update for .NET Framework 3.5 SP1 doesn't seem to work properly and think that it might be that I need to install this update on the server as well as the Build Server. http://www.microsoft.com/downloads/en/details.aspx?familyid=4b710b89-8576-46cf-a4b...

Custom provider with ADO .NET Entity Data Model and OData

Hi, I have two data provider services, they provide access to two different databases. These data services used XSD to generate the dataset objects and allow the user to perform the CRUD operation on the data. I want to use ADO .NET Entity framework and ODATA to define a common service which will interact with these two services (as re...

Incorrect Syntax near the keyword UNION

I am getting an error message as 'Incorrect Syntax near the keyword UNION. The target site is - Void ProcessResults(System.Data.OleDb.OleDbHResult) and the stacktrace is as follows:- at System.Data.OleDb.OleDbDataReader.ProcessResults(OleDbHResult hr) at System.Data.OleDb.OleDbDataReader.NextResult() at System.Data.OleDb.OleDbCo...

ObjectDataSource binding concerns

Hi guys - I'm well aware of the general pros (quick, fast, easy, codeless approach; support for paging & sorting) and cons (isolated data logic on presentation side) of ODSs, but I'm wondering about the pros and cons of using multiple ObjectDataSource objects on a page and the cost on memory/performance. I'm currently building a page wh...

error in converting datatype nvarchar to bigint

this code is giving me error: error in converting datatype nvarchar to bigint this is my table values: @customer_first_name nvarchar(50), @customer_last_name nvarchar(50), @customer_address nvarchar(max), @gender nchar(10), @date_of_birth datetime, @customer_email_id varchar(50), @customer_occuption varchar(50), @customer_phone_...

Primary key violation constraint

string sqlInsert = "Insert into account_details( account_number, account_type, transfer_access_code, account_balance, customer_id) SELECT account_number, account_type, transfer_access_code, account_balance, customer_id from customer_details"; This query just takes data from customer ...

error 'there is already an open datareader associated with this command which must be closed first'

Hello, runtime error 'there is already an open datareader associated with this command which must be closed first' objCommand = new SqlCommand("SELECT field1, field2 FROM sourcetable", objConn); objDataReader = objCommand.ExecuteReader(); while (objDataReader.Read()) { objInsertCommand = new SqlCommand("INSERT INTO tablename (field1, ...

AsParallel with classic ADO.NET

I'm wondering if using by AsParallel would speed up my code in the way we use it. I write here some very simplified pseudo code, to illustrate what I have in mind: Let's say 3 SqlCommand under the same SqlConnection like this (pseudo code): RunADOQueryForRequest() // returns one row RunADOQueryForRequestAnswer() // returns about 100 r...

SqlDataAdapter Output Variable Question C#

I do not clearly understand how to format the SqlDataAdapter for output variables when working with C# Error Message: Index (zero based) must be greater than or equal to zero and less than the size of the argument list. Code Example (Stored Procedure works fine) private DataTable updateOrdEodHold(DataTable tb, out string mn...

Silverlight connectivity with database using ado.net

Hi All I want to connect my sql server 2005 database using ado.net in silverlight. I want to connect manually to my database. Please give me examples of populating gridview in silverlight manually. Thanks ...

Exception thrown when retrieving ODBC schema using .Net System.Data.ODBC

Our customer is using a driver by iWay Software to provide ODBC access to sequential files on a mainframe system. They are able to access the data successfully from Excel using the ODBC source but when we try to access the schema information using GetSchemaTable() on a successfully opened DbDataReader the following exception is thrown: ...

Workflow authorisation with many clients, workflows and users

Hi All, I can't seem to find any documentation/examples for situations where a WF application has multiple workflows, a single one selected and started against a single user. I have a scenario where I have multiple clients using a WF enabled web application. Each of these clients will have 1 or more workflows available to them that th...

should I use a static DbUtil class for web, is it dangerous ?

is it ok to use something like this in the web: (my application is on asp.net mvc) public static class DbUtil { public static int Insert(object o, string cs) { using (var conn = new SqlConnection(cs)) using (var cmd = conn.CreateCommand()) { ... conn.Open...

2 sibling nested transactionScope gives: the Transaction has aborted

this code gives me the error: the Transaction has aborted. if I remove 1 nested transaction than it doesn't throw using(var scope = new TransactionScope()) { repo.Insert(new Foo {Fname = "aaaa"}); using(var s = new TransactionScope()) { repo.Insert(new Foo { Fname = "aaaa" }); //if ...

exception while adding multiple rows to datatable. Couldn't store <System.Data.DataRowCollection>

idLocals is Primary key in database Populating the datatable oDtLocalCharge = bll.GetData(); i am copying the datatable in another function dtLocalCharges = oDtLocalCharge.Copy(); and trying to add rows using below code DataRowCollection drr = oDtLocalCharge.Rows; dtLocalCharges.Rows.Add(drr); When i try to add rows to dat...

Creating a DataTable or DataView with Distinct entries

I have the following XML file <Department> <dept> <category>HR</category> <performance>8.2</performance> <month>3</month> </dept> <dept> <category>Marketing</category> <performance>8.8</performance> <month>3</month> </dept> <dept> <category>HR</category> <performance>7.2</pe...

SqlDataReader Read method

Does the read method just position itself to next record? or it actually reads the record? lets say i call read 1000 times, does it actually get all values of that each records? or its when I call GetValue? ...

Concurrency Issue Updating Dataviews Then Datatables

I have created a Dataview on my datatable Dim _viewbyJob As New DataView(objts) I use this to get a certain row out of the datatable. When I wan to update the datatable like so.. objta.Update(objts) I get a concuurency exception. Concurrency violation: the UpdateCommand affected 0 of the expected 1 records. I can see that the da...

How can I use single query to insert multiple records from Dataset into SQL Server 2005 ?

I have a dataset in ADO.NET containing multiple records from user side. I need to insert all those rows in single query into the database, in order to avoid multiple queries ...