data-access

Why switch from ADO to ADO.NET?

青春壹個敷衍的年華 提交于 2019-12-05 12:02:17
I have some friends who are 'old-school' VB6 database developers and I was telling them about .NET and its features, specifically ADO.NET. In our conversation, they brought up the following reasons why they would rather stick with ADO than move to ADO.NET: The Dataset is disconnected (What if power fails?) The same amount of code still has to be written The new options of Dataset , BindingSource and TableAdapter seem confusing the same code is written programatically access the Database, all that changes is how that command is laid out I'm looking for answers or reasons why ADO.NET is 'better'

How to fix “The provider is not compatible with the version of Oracle client”?

两盒软妹~` 提交于 2019-12-04 07:16:21
We're using the Oracle.DataAccess.dll assembly version 2.102.2.20 (32 bit). I deployed our Web API application to IIS and tried openning and closing a connection: private static void CheckConnectionUsingOracleClient(string connection) { var logger = DiContainer.Resolve<ILogger>(); try { logger.LogInfo("Trying to connect to " + connection); // check whether you can connect to the shop using Oracle.DataAccess using (var cnn = new Oracle.DataAccess.Client.OracleConnection(connection)) { cnn.Open(); cnn.Close(); } logger.LogInfo("Succeeded to connect to " + connection); } catch (System.Exception

Creating base class for Entities in Entity Framework

℡╲_俬逩灬. 提交于 2019-12-03 20:51:19
I would like to create a base class that is somewhat generic for all of my entities. The class would have methods like Save(), Delete(), GetByID() and some other basic functionality and properties. I have more experience with Linq to SQL and was hoping to get some good examples for something similar in the EF. Thank you. Like this: public abstract class BaseObject<T> { public void Delete(T entity) { db.DeleteObject(entity); db.SaveChanges(); } public void Update(T entity) { db.AcceptAllChanges(); db.SaveChanges(); } } public interface IBaseRepository<T> { void Add(T entity); T GetById(int id);

WCF DataContracts and underlying data structures

自闭症网瘾萝莉.ら 提交于 2019-12-03 07:24:39
问题 I am wondering what makes sense in relation to what objects to expose through a WCF service - should I add WCF Serialization specifications to my business entities or should I implement a converter that maps my business entities to the DataContracts that I want to expose through my WCF service? Right now I have entities on different levels: DataAccess, Business and Contract. I have converters in place that can map entities from DataAccess to Business and from Business to Contract and vice

WCF DataContracts and underlying data structures

此生再无相见时 提交于 2019-12-02 20:53:47
I am wondering what makes sense in relation to what objects to expose through a WCF service - should I add WCF Serialization specifications to my business entities or should I implement a converter that maps my business entities to the DataContracts that I want to expose through my WCF service? Right now I have entities on different levels: DataAccess, Business and Contract. I have converters in place that can map entities from DataAccess to Business and from Business to Contract and vice versa. Implementing and Maintaining those is time consuming and pretty tedious. What are best practices in

ASP.net DAL DatasSet and Table Adapter not in namespace - Northwind Tutorial

六月ゝ 毕业季﹏ 提交于 2019-12-02 11:47:25
问题 I've been attempting to walk through the "Creating a Data Access Layer" tutorial found http://www.asp.net/learn/data-access/tutorial-01-cs.aspx I create the DB connection, create the typed dataset and table adapter, specify the sql, etc. When I add the code to the presentation layer (in this case a page called AllProducts.aspx) I am unable to find the NorthwindTableAdapters.ProductsTableAdapter class. I tried to import the NorthwindTableAdapters namespace, but it is not showing up. Looking in

ASP.net DAL DatasSet and Table Adapter not in namespace - Northwind Tutorial

别等时光非礼了梦想. 提交于 2019-12-02 03:39:21
I've been attempting to walk through the "Creating a Data Access Layer" tutorial found http://www.asp.net/learn/data-access/tutorial-01-cs.aspx I create the DB connection, create the typed dataset and table adapter, specify the sql, etc. When I add the code to the presentation layer (in this case a page called AllProducts.aspx) I am unable to find the NorthwindTableAdapters.ProductsTableAdapter class. I tried to import the NorthwindTableAdapters namespace, but it is not showing up. Looking in the solution explorer Class View confirms that there is a Northwind class, but not the namespace I'm

How in .Net do I Import Values from a CSV in the format I want using OleDB?

佐手、 提交于 2019-12-01 21:55:44
I have a CSV file that has a column that contains strings that look like integers. That is they should be dealt with as strings, but since they are numbers they appear to be imported as integers (dropping off the leading zeroes). Example Data: 0000000000079 0000999000012 0001002000005 0004100000007 The problem I'm seeing is that the last example data point comes through as DBNull.Value. I'm assuming this is because OleDB is treating that column as an integer (the data points come through without their leading zeroes also) and that 0004100000007 is greater than the largest integer value. Is

Spring mvc:resources access to outside folder

回眸只為那壹抹淺笑 提交于 2019-12-01 19:01:24
I have stored medias (pictures and movies) in a folder (for example C:\test\tes.png) and I'm trying to access to pictures with an url like : http://localhost:8080/app/picture/test.png . To do that, i have used resources tag (spring 3) as below : <mvc:resources mapping="/picture/**" location="file:/test" /> When I try to access, I have an error with no more details. Requested Resource Not Found I have in logs : 2011-11-07 20:48:55,241 [http-8080-2] DEBUG org.springframework.web.servlet.DispatcherServlet - DispatcherServlet with name 'Family' processing GET request for [/Family/photos/testImage2

Java: Advice on handling large data volumes. (Part Deux)

☆樱花仙子☆ 提交于 2019-11-30 22:24:14
Alright. So I have a very large amount of binary data (let's say, 10GB) distributed over a bunch of files (let's say, 5000) of varying lengths. I am writing a Java application to process this data, and I wish to institute a good design for the data access. Typically what will happen is such: One way or another, all the data will be read during the course of processing. Each file is (typically) read sequentially, requiring only a few kilobytes at a time. However, it is often necessary to have, say, the first few kilobytes of each file simultaneously , or the middle few kilobytes of each file