ado.net

Disable publish of EF configuration files to bin folder

可紊 提交于 2020-08-10 23:48:08
问题 I never came across the needs until now to do something about publishing of the XML configuration files that come with EntityFramework referenced projects. Those configuration files contain connection strings that are also within the Web.config of the start-up project - which we do not want right now. I understand that those configuration files are mandatory for EF and models while they are within VS, but since the connection string is taken from the Web.config and not Models.dll.config is

Disable publish of EF configuration files to bin folder

☆樱花仙子☆ 提交于 2020-08-10 23:47:31
问题 I never came across the needs until now to do something about publishing of the XML configuration files that come with EntityFramework referenced projects. Those configuration files contain connection strings that are also within the Web.config of the start-up project - which we do not want right now. I understand that those configuration files are mandatory for EF and models while they are within VS, but since the connection string is taken from the Web.config and not Models.dll.config is

Mocking SqlConnection, SqlCommand and SqlReader in C# using MsTest

99封情书 提交于 2020-07-22 18:31:55
问题 I came across this answer and I'm interested in implementing the second answer using Fake. Here's another one. I'm not really understanding all the concepts there and I'm still reading and understanding documentation, can someone help using my code, where I'm trying to access list of customers on how to use Fake/Shim/Stub/Mock here? You may rewrite FindAll method too just in case if it's to be refactored to accept dependencies. Editing after discussion public class Data { private Func

OracleCommandBuilder.DeriveParameters() throws OracleException: ORA-06564: object does not exist ORA-06512: at “SYS.DBMS_UTILITY”

守給你的承諾、 提交于 2020-07-10 06:53:11
问题 Using the OracleClient that comes with ADO.NET in .NET Framework, I'm trying to call OracleCommandBuilder.DeriveParameters() method on a procedure in the database, but I keep getting an OracleException with the message: ORA-06564: object CustOrdersOrders does not exist , even though I created the procedure successfully. I'm more familiar with SQL Server, so perhaps I'm missing something here. SQL file 1.sql: create or replace PACKAGE PKGENTLIB_ARCHITECTURE IS TYPE CURENTLIB_ARCHITECTURE IS

Inner TransactionScope with different IsolationLevel, how can it be achieved?

柔情痞子 提交于 2020-06-27 15:54:09
问题 The current implementation of TransactionScope lacks the ability to change IsolationLevels in nested scopes. MSDN states: When using nested TransactionScope objects, all nested scopes must be configured to use exactly the same isolation level if they want to join the ambient transaction. If a nested TransactionScope object tries to join the ambient transaction yet it specifies a different isolation level, an ArgumentException is thrown. However SQL Server allows us to change Isolation Levels

DataAdapter: Update unable to find TableMapping['Table'] or DataTable 'Table'

本小妞迷上赌 提交于 2020-06-27 07:57:13
问题 This code snippet is throwing an error: Update unable to find TableMapping['Table'] or DataTable 'Table'.) on adapter.Update(ds); line Why it is throwing this type of error? SqlConnection con = new SqlConnection(); con.ConnectionString = connectionString(); DataSet ds = new DataSet(); string strQuery = "SELECT * FROM Cars"; SqlDataAdapter adapter = new SqlDataAdapter(); adapter.SelectCommand = new SqlCommand(strQuery, con); SqlCommandBuilder builder = new SqlCommandBuilder(adapter); adapter

SqlCommand maximum parameters exception at 2099 parameters

若如初见. 提交于 2020-06-24 20:35:15
问题 I am batching different queries in one SqlCommand stopping the queries batch when I hit the 2100 parameter limit. If my batch has 2100 or 2099 parameters I still get the exception. The following test code throws 'too many parameters exception' even if the number of parameters is less than 2100. var parametersMax = 2099; var connection = new SqlConnection(@"Data Source=.;Integrated Security=SSPI;"); connection.Open(); var enumerable = Enumerable.Range(0, parametersMax); var query = string

SqlCommand maximum parameters exception at 2099 parameters

折月煮酒 提交于 2020-06-24 20:31:10
问题 I am batching different queries in one SqlCommand stopping the queries batch when I hit the 2100 parameter limit. If my batch has 2100 or 2099 parameters I still get the exception. The following test code throws 'too many parameters exception' even if the number of parameters is less than 2100. var parametersMax = 2099; var connection = new SqlConnection(@"Data Source=.;Integrated Security=SSPI;"); connection.Open(); var enumerable = Enumerable.Range(0, parametersMax); var query = string

SqlCommand maximum parameters exception at 2099 parameters

*爱你&永不变心* 提交于 2020-06-24 20:30:59
问题 I am batching different queries in one SqlCommand stopping the queries batch when I hit the 2100 parameter limit. If my batch has 2100 or 2099 parameters I still get the exception. The following test code throws 'too many parameters exception' even if the number of parameters is less than 2100. var parametersMax = 2099; var connection = new SqlConnection(@"Data Source=.;Integrated Security=SSPI;"); connection.Open(); var enumerable = Enumerable.Range(0, parametersMax); var query = string