ado.net

ADO.NET TableAdapter parameters

試著忘記壹切 提交于 2019-12-22 05:33:34
问题 I have a query that I wish to run through an ASP.NET TableAdapter that contains an 'IN' clause which is to receive it's values through a parameter. My question is, how do I specify this parameter? I thought of writing the conditional statement like this: AND b.group_category_id in (@ParamList) where the @ParamList is a String of the parameters, e.g. "4,12,45,23" but since the specified id is an Integer, it complains that it cannot convert String to Integer. This makes sense, but is there any

ADO.NET vs ADO.NET Entity Framework

你离开我真会死。 提交于 2019-12-22 05:25:58
问题 What is faster - ADO.NET or ADO.NET Entity Framework? 回答1: Nothing is faster than an ADO.NET datareader. Entity framework also uses this in "the basement". However entitity framework helps you to map from database to objects.. With ADO.NET you have to do that yourself. It depends on how you program it how fast it is.. When you use ADO.NET datatables as "objects". They are a bit slower and memory hungry than plain objects.. 回答2: As Julian de Wit says nothing is faster than ADO.NET DataReaders.

SqlClient calls causing “Thread was being aborted at SNINativeMethodWrapper.SNIPacketGetConnection(IntPtr packet)”

落花浮王杯 提交于 2019-12-22 05:23:25
问题 I would really appreciate any suggestions, no matter how simple or complex, to help me get this issue isolated and resolved. I have a bit of code that generates small report files. For each file in the collection, a stored proc is executed to get the data via XML reader (its a pretty big result set). When I created all this, and stepped through it, all is well. Files are generated, no errors. This library is called via remoting, and is hosted via IIS. When I deploy the compiled library and

Why timeout may occur in SqlConnection.Open()?

故事扮演 提交于 2019-12-22 05:16:27
问题 What are the cases when timeout occurs in SqlConnection.Open()? On one of our IIS boxes 10 seconds after AppProcess was recycled the following exception appeared: Type : System.Data.SqlClient.SqlException, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 Message : Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. Source : .Net SqlClient Data Provider Help link : Errors : System.Data.SqlClient

Update big table (a lot of columns). C# .NET

℡╲_俬逩灬. 提交于 2019-12-22 05:05:46
问题 I have to update a big table with over 270 update fields. I am relative new to .NET and need advise what is better to use in this case: SqlCommand, some kind of memory-mapped table or DataSet or maybe it exists some kind of auto-generated objects using meta-data from DB? Please help. Reason: I have an old big Delphi7 application, a part of which is responsible for listening on socket some packets which are marshaled to big structures and, in final step, stored in DB. Now I am porting this

How do ADO.NET DataTable Constraints affect performance?

谁都会走 提交于 2019-12-22 04:59:19
问题 Do constraints on a DataTable (e.g. PrimaryKey & UniqueContraint) make Selects more efficient in the same way that they would in SQL Server? Or is their only purpose to enforce rules on the data? myDT.Constraints.Add("PK", myDT.Columns["UniqueID"], true); //add a primary key myDT.Constrinats.Add(new UniqueConstraint(new DataColumn[] { //add a unique constraint for UserID myDT.Columns["UserID"], myDT.Columns["UniqueID"] })); Would these examples potentially have better performance when looking

Any SQL Server multiple-recordset stored procedure gotchas?

限于喜欢 提交于 2019-12-22 04:39:43
问题 Context My current project is a large-ish public site (2 million pageviews per day) site running a mixture of asp classic and asp.net with a SQL Server 2005 back-end. We're heavy on reads, with occasional writes and virtually no updates/deletes. Our pages typically concern a single 'master' object with a stack of dependent (detail) objects. I like the idea of returning all the data required for a page in a single proc (and absolutely no unnecesary data). True, this requires a dedicated proc

How to use the poco entity generator

纵饮孤独 提交于 2019-12-22 04:04:08
问题 I'm using VS2010, and I've download the C# POCO Entity Generator and installed it, now I want to use it. I can't read the toturial 1 and I can't find any other good toturials, so I've had a go myself - I have created a model and then I'm creating new POCO Entity, but I got the bellow error: Error 1 Running transformation: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.IO.FileNotFoundException: Unable to locate file at

Auditing in Entity Framework

拈花ヽ惹草 提交于 2019-12-22 01:15:23
问题 After going through Entity Framework I have a couple of questions on implementing auditing in Entity Framework. I want to store each column values that is created or updated to a different audit table. Right now I am calling SaveChanges(false) to save the records in the DB(still the changes in context is not reset). Then get the added | modified records and loop through the GetObjectStateEntries. But don't know how to get the values of the columns where their values are filled by stored proc.

SQL Server communication protocol issue

泄露秘密 提交于 2019-12-21 22:55:34
问题 I am using VSTS 2008 + C# + ADO.Net + SQL Server 2008. My questions about what kinds of communication protocols SQL Server 2008 will be using, more details of my questions, If the connection string looks like this, whether Named Pipe or TCP/IP is used? Will different communication protocol being used dependent on whether client and SQL Server on the same machine? Data Source=labtest1;Initial Catalog=CustomerDB;Trusted_Connection=true;Asynchronous In SQL Server Configuration Manager, there are