.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Under the Table: How Data Access Code Affects Database Performance

Posted By:      Posted Date: August 21, 2010    Points: 0   Category :ASP.Net

In this article, the author delves into some commonly used ways of writing data access code and looks at the effect they can have on performance.

Bob Beauchemin

MSDN Magazine August 2009

View Complete Post

More Related Resource Links

Error in Uploading Files to Access 2010 Web Database Table with Data Macro


Hi All,


I've recently published an Access 2010 Web Database to the SharePoint 2010 farm in my organization and I'm having the strangest problem.

I have a table which includes an Attachment field. When trying to upload a file through the web I get the following error: "There was an error uploading your attachment to the server".

Now, this table has a "Before Change" Data Macro, which basically executes a simple LookUp of several parameters from another table and writes them back to the "master" table. When deleting this Data Macro, upload on the Web works fine.

The thing is that when working from the local Access file (connected to the SharePoint) and trying to change a field in the table, the following error is received: "The Microsoft Access database engine encountered an error whil

Create/add table from code to database



I create table:

                  DataSet data=new DataSet();

                  DataTable myTable = new DataTable("NewTable");

                   DataColumn[] keys = new DataColumn[1];

                   // create column
                   keys[0] = new DataColumn();
                   keys[0].DataType = System.Type.GetType("System.String");
                   keys[0].ColumnName = "PointID";
                   myTable.Columns.Add(keys[0]);    &nb

Data Points: Deny Table Access to the Entity Framework Without Causing a Mutiny


Julie Lerman shows database administrators how to limit access to databases from the Entity Framework by allowing it to work only with views and stored procedures instead of tables-without impacting application code or alienating developers.

Julie Lerman

MSDN Magazine August 2010

Data Points: Windows Azure Table Storage - Not Your Father's Database


Let go of your traditional relational database thinking if you want to understand how Windows Azure Table storage works, says Julie Lerman. Luckily for you, she's done the hard work to grasp the new concepts and help you get up to speed.

Julie Lerman

MSDN Magazine July 2010

need your help regarding table and database.. without data lose



I have a table like this in database

ItemNo ItemName Qty  

001       A               50       

002       A               20      

003       B               50  

004       C               60      

005       D               40 

006       E               90      

upto it has some 3000 rows in table..

Now what my problem is i have one more field in mydevelopment PC let us consider another column Category

I need to update this column to my client pc without losing 3000 data from table which already exist...

How to do...?

Entity Data Model and database view returning the same columns as there are in a table


When adding a stored procedure into the Entity Data Model I can select whether the procedure returns a scalar, a (new) complex type or one of the entity types I already defined. 

How do I do something similar for a view?

I mean assuming I have a view like this

CREATE VIEW FilteredFoos as SELECT Foo.* FROM Foo join ... WHERE ...

(that is a view that implements some involved filtering, but returns all columns from one table) how do I add it to the project so that I can use the entity set, but get the Foo objects, not some new FilteredFoo objects.

var foos = myDB.FilteredFoos.Include("Bar").ToList();

foreach (Foo foo in foos) { ...

Thanks, Jenda

Errors in the back-end database access module. OLE DB reported an overflow of the data type for colu

Getting an error when processing a dimension, Errors in the back-end database access module. OLE DB reported an overflow of the data type for column 0. Errors in the OLAP storage engine: An error occurred while the 'xxxxxx' attribute of the 'Dim XXXXXX' dimension from the 'XXXXXXX' database was being processed. Content of this dimension is very similar to one that is processing no problem. The content of the dimension is one field only of type date.  The original content was imported through SSIS from a DB2 database on an iseries machine.  Thought a first the issue was because of the data contains some null values but the dimension the process OK also has some null  values.  The dimension that processes ok is also a single field of type date. Any help greatly appreciated, Roscoe

reading xml data and insert into database table

hi friends, .very urgent for me so only i send following script i create for read xml data and to import to table. i got result for reading xml and rows are added to table but the values are showing null pls clarify this problem. thanks alter procedure pizza_sales ( @xml xml ) as begin INSERT INTO pizza_xml (LOC_CODE, CUST_CODE, PRODUCT_ID, INV_TYPE, INV_NO, INV_DT, INV_QTY_IN_INV_UOM, INV_RATE_IN_BS_CURR, INV_VU_IN_INV_CURR, -- TOTAL_DISC_IN_BS_CURR, NET_INV_VU_IN_INV_CURR, NET_INV_VU_IN_BS_CURR, TOTAL_TXES_IN_BS_CURR ) select table1.column1.value('@LOC_CODE','nvarchar(75)'), table1.column1.value('@CUST_CODE','nvarchar(75)'), table1.column1.value('@PROD_CODE','nvarchar(75)'), table1.column1.value('@INV_TYPE','nvarchar(50)'), table1.column1.value('@INV_NO','nvarchar(100)'), table1.column1.value('@INV_DT','datetime'), table1.column1.value('@INV_QTY_IN_INV_UOM','numeric(28,8)'), table1.column1.value('@INV_RATE_IN_BS_CURR','numeric(28,8)'), table1.column1.value('@INV_VU_IN_INV_CURR','numeric(28,8)'), --table1.column1.value('@TOTAL_DISC_IN_BS_CURR','numeric(28,8)'), table1.column1.value('@NET_INV_VU_IN_INV_CURR','numeric(28,8)'), table1.column1.value('@NET_INV_VU_IN_BS_CURR','numeric(28,8)'), table1.column1.value('@TOTAL_TXES_IN_BS_CURR','numeric(28,8)') from @xml.nodes('pizza/pizzaxml')as table1(column1) end declare @id

Remote Data Access encountered problems when opening the database.

Hello,   I have some toubles with SQLCERemoteDataAccess   The exceptions are thrown on rda.Pull("Article", "Select * from Article", _ rdaOleDbConnectString, _ RdaTrackOption.TrackingOnWithIndexes, _ "ErrorTable")   with follow parameters : rdaOleDbConnectString = "Data Source=MyServeur;Initial Catalog=BddClient;User Id=admin;Password=admin;" InternetURLString = ""; LocalConnectString = "\\BACKUP\\AppliClient\\Bdd.sdf"     And the followinf error : Error Code: 80004005 Message : SQL Server Compact encountered problems when opening the database. [Internal Error Number =0, Internal Error String = ] Minor Err.:28559 Source :Microsoft SQL Server Compact   Error Code: 80004005 Message : Minor Err.:0 Source :Microsoft SQL Server OLE DB Provider My CE database file Bdd.sdf exist on pocket pc, and I access to the sqlcesa35.dll with IE. The server is a Windows Server 2003 SP2 using SQL Server 2005.   Thank you in advance

How to copy table data from test to production database

I'm using SQL Server 2008 R2 and I'd like to copy all data rows from one table of a test database to the identical table in a production database. The primary key of the table is referred to by other tables so a DELETE followed by a number of INSERTs won't do it because of referential integrity issues. What is the best method to replace the data rows in the destination database with the values from the source database? Thanks, Guido

I need to create a script in SSIS which creates a data source that connects to an Access database.

I need to create a script in SSIS which creates a data source that connects to an Access database. The Access database file name needs to be set as a variable as it will change from month to month. I have no idea what I am doing can anybody give me some tips? Mr Shaw

inserting an array of data into a database table

im looking to insert an array of information into a database tableessentially what id like to do is something like this:            objCmd = New OleDb.OleDbCommand("INSERT INTO pluINFO VALUES *", objConn)            For j = 0 To 265                objCmd.Parameters.Add( info(j) )            Next this code gives me a syntax error for the insert statement is there anyway i can set the insert statement that would allow me to add each element of the array(looping through rather than hardcoding several hundred entries) into the table?any input appreciatedThanks

Creating table with database data, ASP.net and C#

Hi!I just started with my first ASP.net page with C# and I want to create a dynamic table with information from my database. I have connected to the database to the page with datareader, so that is solved. The problem is making the table and import the data into the different rows and columns. I also want the possibility to edit and remove this information from the table. Its supposed to be a table with information about customers.I have no idea whats the best solution for this and I hope you guys got information or links that show how to do this?Regards,fh01

How to submit data to a SQL Server database table from a custom page ?

Using SPD, I have created a custom page. It has a form with ASP.NET controls textbox, radio buttons, dropdown, submit button etc., Also, I created a Database connection (to the SQLServer database table) under Database Connections. But not sure how to connect this form to the database connection so that when form data is submitted, the data will be inserted into the table.

Starting Data Access Layer Tutorials - Confusion on Database downloads

Hello.I have really enjoyed going through the Security Tutorials. They were well done and I think I learned a lot.I am just about to start the first Data Access Layer Tutorial. I am a little bit confused.I have MS SQL Server 2005 and MS Visual Studio 2005 on my laptop.The first tutorial says to download and use the Northwind database. But, the link in the tutorial goes to a MS page that says that the Northwind database is for SQL Server 2000 - although it will work with 2005. The page suggests that I use the AdventureWorks database with 2005. But, when I click on the link for that page it says that this database is now on CodePlex servers and gives me yet another link.I just want to use the right database for this tutorial. Can someone please explain to me what is the right process for this tutorial? Will I just be able to download and run the EXE for the Northwind database with what I have and immediately be able to start going throgh the tutorial? Or, will I need to make some adjustments since the Northwind DB is for SQL Server 2000? I just don't want to get something installed and then have to back out of it.Thanks.

Link/Connect SQL CE Table to Access MDB for VBA Code Processing

I'm hoping to connect an SQL CE file (main.dat) to an Access DB so I can run some vba code which:

1. Uses DAO to open a recordset (a table in the SQL CE DB)
2. Uses a field containing paths to mp3 files to extract the id3 tag data
3. Update an existing field from the same table/Same SQL CE DB

I've looked around and can't seem to find any ODBC driver(s) for SQL CE.  Got some info from Erik who suggested I post here.

Thanks in advance!

EDIT:  I just now was able to get Erik's code to work in Excel from my DB.  But I'm not sure how to send it back to the SQL CE DB from VBA... Is it possible?

multiple access to sql server database, one table


I have multiple apps running which access a sql server database. I had initially a table set aside for each app but now I was told to put everything into one table and have all apps access the database. I just want to make sure that just changing my connection string for all apps will suffice and that I do not have to make any other changes for all apps to write to one table. Will this be ok? The apps are writing to the database table which has a unique index on one column and a auto incremented primary id key. I changed the stored procedures I had for each app since the connection strings were the same as they access the same database. Just want to make sure there will be no conflict issues when each tries to write to the same table. None of the apps will be querying the table at any time except when I run manual queries myself.

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend