dataaccess

ORM vs Handcoded Data Access Layer

I'm a bit scared to ask this question as it may start a religous war so I want to be really clear on what I'm looking for. I'm looking for a reason(s) why you would or have jumped one way or the other and also for items to add to my lists. I'm looking for the big ticket, big bang items. Also, items specific to a product, maybe, if they a...

C# static database class?

I have a Database class which contanins the follwing methods: public bool ExecuteUDIQuery(string query) // UDI = Update Delete Insert public bool ExecuteSelectQuery(string query) public bool ExecuteSP(string sp, string[,] parms) public int ExecuteSPReturnValue(string sp, string[,] parms) The results of the methods are stored in priva...

SOA - data access for business services as a separate web service or no?

Currently inside my organization we are trying to come up w/ some conventions for a pilot SOA project. At first glance we thought it would be best to force users of the service to use the business service w/out direct access to any data endpoints .. but are there specific scenarios where this is not true or it might be "valid" for devel...

Is LinqToSQL the same as Linq?

I was just reading about Linq to SQL being discontinued. For a while I put off learning Linq at all. Even on asp.net, when I last checked, their data access tutorials were using table adapters and bll classes. Then there are linq tutorials. Now that I have read this and that the Entity Framework is the new way to go, does that mean a...

Using NHibernate for SQL query generation

NHibernate provides us with ORM capabilities. Part of NHibernate generates queries based on mappings and HQL (or ICriteria). I'm wondering if it is possible to use NHibernate for generating queries against databases without using its ORM capabilities. I'm trying to provide customers with custom access to their database. Since the schema...

Most Efficient Way To Get A Row Of Data From DB In ASP.NET

Hi guys and girls, I'm writing a method to return an 'asset' row from the database. It contains strings, ints and a byte array (this could be an image/movie/document). Now for most row access I use the following method which returns a NameValueCollection as it is a light weight object, easy to use and cast int and strings. p...

System.ComponentModel.Component in Visual Studio 2008

I'm maintaining a .Net 2.0 application using Visual Studio 2008. When the application was built, it was originally in Visual Studio 2003 and made use of the System.ComponentModel.Component class for data access. You can drag and drop commands, connections, etc onto the designer surface of the component. In 2008, the data access classes ...

What should I be using with ASP.Net MVC, NHibernate, LINQ, EF?

Hi I posted a question a little earlier and I had some replies that I should look at some different technologies. Which of the above (or other feel free to mention) is the most popular or best supported. As stated in my earlier question I am learning ASP.Net MVC. I come from a Java struts background but I am prepared to try and learn wh...

Multiple SQlCommand.ExecuteReader calls or do it once with datareader.NextResult()?

I'm using a SqlDataReader to populate an entity in a Winform app. The entity class has several foreign key attributes in the database that I want to setup as properties in the entity class. Each property will be of type 'Attribute' with an ID & Description property. Some of the users of the system are far from the database, so data acc...

Enterprise Library Data Access Block Transaction Management Best Practice

What is the best practice for processing a batched series of CRUD operations in a single transaction with the Enterprise Library Data Access Block that it won't be esclated to a distributed transaction? Edit Full Source: public void BatchInsertEvents(IList<EventItem> events) { _dataAccessBase = new DataAccessBase("[dbo].[EventInser...

Server control/data access best practice?

Is it better to access data from within the web parent app and pass the necessary data to the control and back via properties, or pass a reference or url pointer (of webservice) to control and let it access the data for the fields it encompasses keeping in mind that the parent doesn't need to use the data anywhere else that the server co...

Implement storage of data between calls? (C# - WPF)

Hi guys, I have an ALPHA application which allows you grab an obfuscated font from and XPS file and store the .odttf file for use in Silverlight. The application "works" as in it does what it says on the tin, albeit in a very rough sort of way. In the process of cleaning this tool up to create the BETA I can across an issue. I want the...

SqlBulkCopy with SqlHelper class

I've installed DataAccessApplicationBlock.msi and I got the Microsoft.ApplicationBlocks.Data.dll file into my bin folder. I found every other sqlhelper methods except ExecuteBulkCopy. How do I add ExecuteBulkCopy function to the SqlHelper class? ...

ORM vs parametrized queries if my only concern is speed of data access

I work in an ASP.net/ SQL Server development environment. If my only concern is speed should I go with parametrized queries or should I use an ORM such as nHibernate or LINQ? ...

SQL Compact allow only one WCF Client

Hi, I write a little Chat Application. To save some infos like Username and Password I store the Data in an SQL-Compact 3.5 SP1 Database. Everything working fine, but If another (the same .exe on the same machine) Client want to access the Service. It came an EndpointNotFound exception, from the ServiceReference.Class.Open() at the Sec...

Oracle.Dataaccess error ORA-06502: PL/SQL: numeric or value error: character string buffer too small

I am invoking a stored proc from .NET app. The proc returns an out parameter of type Varchar2. To fet ch the out parameter I am passing the parameter to the command as OracleParameter: parm12 = new OracleParameter("testkey" , OracleDbType.Varchar2 , out2 ...

Where to put restrictions on entities when separating Business layer from Data Layer

I am attempting to create the the business and data layers for my big ASP.NET MVC application. As this is the first time for me attempting a project of this scale I am reading some books and trying to take good care at separating things out properly. Usually my applications mix the business logic and data access layers, and multiple bu...

Retrieving encrypted data in code

I am using sql server 2k5 database encryption with a symmetric key protected by password. Symmteric key password is stored in memory on the server and cannot be stored in plain text in sps. In SQL Mgmt Studio, i run a query opening key, exec Mysp and closing key - data returns decrypted. In my c# code tho, when i want to call the same s...

Error when connecting to AS400 (ISeries)

I'm trying to connect to a AS400 server using the .net classes. I have added a reference to IBM.Data.DB.iSeries and I use the following code: var conn = new iDB2Connection("DataSource=111.111.111.111;UserID=xxx;Password=xxx; DataCompression=True;"); conn.Open(); But I get the following exceptions Running 64 bit: "The provid...

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

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 un...