ado.net

Best Hardware Configuration for ASP.NET Hosting Application

We have developed a vacation rental application in ASP.NET with SQL server as DB. Used .NET 3.5 with Entity Framework. Currently QA test this with P4 machine with 2GB RAM. Looks like the processor utilization goes up to 50% for every request. All our DB retrieval timings are < 1 sec. The page load is very slow. We applied all performance...

Oracle query fired off, then never returns

I have this problem in my ASP.NET application where I'm seeing some of my Oracle queries fired off to the server then not returning. Ever. It happens in several places in my app and I can't explain it. Here's one specific scenario where I'm seeing this behavior: During application start-up I am pre-fetching data asynchronously into the ...

import from text file to SQL Server Database, is ADO.NET too slow?

My program is now still running to import data from a log file into a remote SQL Server Database. The log file is about 80MB in size and contains about 470000 lines, with about 25000 lines of data. My program can import only 300 rows/second, which is really bad. :( public static int ImportData(string strPath) { //NameValueCollection...

SELECT'ing a master record and all its related foreign detail records, in a single query?

I have a table that could have thousands (millions maybe?) of records. It is basically an audit trail table that stores special log entries. It's called "Logs". There is also a related table called "LogsExtended" which stores zero or many additional records for each entry in the Logs table. There is a foreign key relationship setup, co...

ADO.NET - Manually filling out column

(Using Visual Studio 2005 / .NET 2.0) I have a DataSet which is being prepopulated from another module using SQL. All the values in it are fine and will stay the same as they are. But once I retrieve the DataSet (and assign it to a DataTable since it is a one-table set) I need to add an additional column onto the end of the DataTable a...

Error in ExecuteReader

I am getting the following error message: System.InvalidOperationException: ExecuteReader requires an open and available Connection. The connection's current state is Closed. And here is my code: public IDataReader ExecuteReader() { IDataReader reader = null; try { this.Open(); reader = cmd.ExecuteReade...

what happens to my dataset in case of unexpected failure

i know this has been asked here. But my question is slightly different. When the dataset was designed keeping the disconnected principle in mind, what was provided as a feature which would handle unexpected termination of the application, say a power failure or a windows hang or system exception leading to restart. Say the user has enter...

Determine string literal escape characters in Ado.net

Given any DbConnection from any Data Provider, is it possible to determine the character or characters used to quote a string literal as well as escape any special characters within the string? I'm also interested in the characters necessary for quoting schema/table/column name identifiers. Using parameters to specify these things is no...

Updating Database with DataAdapter.Update Method

Hello, I have imported a ms access database into ms visual c# 2008, it read the fields in the database, but when updating it only updates the dataset and not the actual database, function code System.Data.OleDb.OleDbDataAdapter da; private void button2_Click(object sender, EventArgs e) { System.Data.OleDb.OleDbCommandBui...

ASP.Net DynamicData pages scaffolded from DB tables: is there a simple way to change their names?

ASP.net scaffolding creates administrative page names by adding a 'S' to the name of the table. Thus the editing page for User table is named Users, and so on. Is there a simple way of changing that name without creating custom pages? For instance for the table "Business" I'd like ASP.net DynamicData to create an administrative link ...

ADO.net Entity Framework: Update only certian properties on a detached entity

I want to update an entity without loading the entity from the database first. I've accomplished this but only by knowing all of the entities properties and then using the "attachto" method. My issues is i don't want my app to need to remember all of the properties. Example: Dim customerEntitiy As New shopper customerEntitiy.shopp...

need help on ADO.net connection string

I have to get the data from a User site. If I would work on their site, I would VPN and then remote into their server using username and password. I thought getting data into my local machine than getting into their server where my work is not secured. So, I thought of using Ironpython to get data from the remote server. So, I still V...

Is there support in the .NET Framework to map .NET data types to their corresponding SqlDBType?

I'm curious if there is support in the .NET Framework to map .NET data types to the corresponding enumeration SqlDbType that represents the data type in SQL. For Instance: dim mySqlDbType as SqlDbType = SomeFunction(GetType(myObject)) ...

Int32.TryParse() or (int?)command.ExecuteScalar()

I have a SQL query which returns only one field - an ID of type INT. And I have to use it as integer in C# code. Which way is faster and uses less memory? int id; if(Int32.TryParse(command.ExecuteScalar().ToString(), out id)) { // use id } or int? id = (int?)command.ExecuteScalar(); if(id.HasValue) { // use id.Value } or int...

Very slow connection to SQL Server 2005 only if using ADO.NET with SqlClient

I have a brand new server with Windows 2008 Server 64 bit + SQL Server 2005 Standard Edition SP3. When I try to open a connection to this server from a client in the same domain (Windows XP, .Net 3.5), it takes around 20 seconds to open the connection. After opening the connection, everything is fast as usual. When using a MDAC 2.8 co...

Which is locale-aware: OleDb.Currency or OleDb.Decimal?

This is two-fold. I have an Access database and a table containing MS Access Currency fields. My customers in the USA use decimal values like 1.23 and my customers in Ecuador use decimal values like 1,23. I have some ADO legacy code and I've tried creating ADODB Parameters with type adDecimal and also with type adCurrency. In either ...

determining transaction level in stroed procedures via sql trace

I am using read committed transactions in my asp.net application. I'm supsicious that somehow when I get to SQL Server read commited isn't being used. Is there a way to determine via a SQL Trace what the isolation level of a transaction is. All I can see is BEGIN TRANSACTION ...

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

LINQ deletion - Can delete one way, can't using Single enumerable

This works: var i = (from x in db.Test where x.Id == 1 select x).First(); db.Test.DeleteOnSubmit(i); db.SubmitChanges(); I get a cast error for this (int/string): var i = db.Test.Single(x => x.Id == 1); db.Test.DeleteOnSubmit(i); db.SubmitChanges(); I was also able to make an update using Single sucesssfully on the same ta...

Storing settings: XML vs. SQLite?

I am currently writing an IRC client and I've been trying to figure out a good way to store the server settings. Basically a big list of networks and their servers as most IRC clients have. I had decided on using SQLite but then I wanted to make the list freely available online in XML format (and perhaps definitive), for other IRC apps ...