ado.net

BindingSource.Filter Problem [C# 2.0 on vs2008]

BindingSource.Filter property is doesn't work while i filter with the unicode characters. any soluctoion for that? or how to implement custom BindingSource to use correct filter property. ...

ADO.NET zombie transaction bug? How to ensure that commands will not be executed on implicit transaction?

e.g. When deadlock occurs, following SQL commands are successfully executed, even if they have assigned SQL transaction that is after rollback. It seems, it is caused by a new implicit transaction that is created on SQL Server. Someone could expect that ADO.NET would throw an exception that the commands are being executed on a zombie tr...

Error invoking stored procedure with input parameter from ADO.Net

Hello everyone, I am using VSTS 2008 + C# + .Net 3.5 + ADO.Net. Here is my code and related error message. The error message says, @Param1 is not supplied, but actually it is supplied in my code. Any ideas what is wrong? System.Data.SqlClient.SqlException: Procedure or function 'Pr_Foo' expects parameter '@Param1', which was not...

Import manually created DataTable into a DB table.

If I manually create a DataTable with columns identical to an actual database table, is there any way I can merge my 'artificial' data rows with a DataTable populated from the DB? By merge I mean eventually a DB insert will be performed for 'artificial' rows that don't exist in the DB, and an update for 'artificial' rows that correspond...

connecting to oracle database from c# asp.net mvc website

I am trying to connect to oracle database. I am able to connect to it through a local SQL Developer tool by sticking something in the oranames.tns file. My question is that i will be deploying this website to a number of places. A few questions: What is the simplest way i can use to connect to this database and do very basic queries...

DataSet v/s Database

While designing applications it is a very good practice to have all the business logic in one place. So why then we sometimes have the business logic in stored procs? Can we fetch all data from the DB and store it in a DataSet and then process it? What would be the performance of the app in this scenario? ...

Binary serialization of datasets parameters in web services

In a system with both ends (client and server) in .NET, is it possible to use the binary serialization provided by the dataset class in ADO.NET 2.0 when the datasets are exposed as WebMethods parameters ? Is it ok to use something like the following just before the dataset is returned: someDataSet.RemotingFormat = SerializationFormat.B...

ado.net slow updating large tables

The problem: 100,000+ name & address records in an access table (2003). Need to iterate through the table & update detail with the output from a 3rd party dll. I currently use ado, and it works at an acceptable speed (less than 5 minutes on a network share). We will soon need to update to access 2007 and its 'non jet' accdb format to ...

ADO.NET Entity Framework software requirements

Hi, I have .net 3.5 SP1 and VS 2008 SP1 installed in my machine. But what should I further install to create an Entity framework project. Is there any other add ons that is needed? ...

Entity Framework 4 with Existing Domain Model

Hi, Im currently looking at migrating from fluent nHibernate to ADO.Net Entity Framework 4. I have a project containing the domain model (pocos) which I was using for nHibernate mappings. Ive read in blogs that it is possible to use my existing domain model with EF4 but ive seen no examples of it. Ive seen examples of T4 code generati...

ADO.net entity framework- Bridge entities

Hello, I have used ADO.net entity framwork to build my application. My application's data diagram contains 2 bridge entities. The problem is that I can not see or access these bridge entities in ADO.net framework using domain services. Do you have any idea how to use CRUD operations on them? Regards, ...

Different datatype for time

what are the different datatype for the time attribute. i m using sql server 2008 ...

Sort a GridView Column related to other Table

Hello, i have a GridView bound to a DataView. Some columns in the DataView's table are foreignkeys to related tables(f.e. Customer). I want to enable sorting for these columns too, but all i can do is sorting the foreignkey(fiCustomer) and not the CustomerName. I have tried this without success(" Cannot find column ERP_Customer.Custo...

Entity Framework 4.0 Mapping POCOS with different property names from db fields names

Hi, I'm a newbie to ADO.Net Entity framework 4. I have a set of pocos which I need to map to a legacy database. The problem is that the db field names are different to the poco property names. eg. db field name = 'cusID' and poco property = 'CustomerID'. What is the best way to map these? ...

SqlParameter contructor compiler overload choice

When creating a SqlParameter (.NET3.5) or OdbcParameter I often use the SqlParameter(string parameterName, Object value) constructor overload to set the value in one statement. When I tried passing a literal 0 as the value paramter I was initially caught by the C# compiler choosing the (string, OdbcType) overload instead of (string, Obj...

SQL Cursors in LINQ2SQL or ADO.NET.Which is good ?

I am in a process of rewriting an old web application to WPF application.The other parts(which other team members handles) of the project is using LINQ to SQL for handling data access.The old application was using some stored procedures which has several updates statement(to many tables).some stored procedures even have cursors running i...

How to prevent bindingsource to change its underlying dataview's filter?

I have noticed the following behavior, which I believe is 'wrong'. I have a BindingSource that I am using to populate a datagrid, and I am using a DataView as the BindingSource.DataSource, something like this: MyDataView = New DataView(MyTable, Filter, SortCol, _ DataViewRowState.CurrentRows) at this point in time the view is properl...

Specific cast is not valid, while retrieving scope_identity

I am getting exception: "Specific cast is not valid", here is the code con.Open(); string insertQuery = @"Insert into Tender (Name, Name1, Name2) values ('Val1','Val2','Val3');Select Scope_Identity();"; SqlCommand cmd = new SqlCommand(insertQuery, con); cmd.ExecuteNonQuery(); tenderId = (int)cmd.ExecuteScalar(); ...

what is the optimal database connection strategy

i have a asp.net mvc website which runs a number of queries for each page. Should i open up a single connection or open and close a connection on each query? ...

.NET TDD with a Database and ADO.NET Entity Framework - Integration Tests

Hello, I'm using ADO.NET entity framework, and am using an AdventureWorks database attached to my local database server. For unit testing, what approaches have people taken to work with a database? Obviously, the database has to be in a pre-defined state of change so that the tests can have some isolation from each other... so I need...