ado.net

Association end is not mapped in ADO entity framework

I am just starting out with ADO.net Entity Framework I have mapped two tables together and receive the following error: Error 1 Error 11010: Association End 'OperatorAccess' is not mapped. E:\Visual Studio\projects\Brandi II\Brandi II\Hospitals.edmx 390 11 Brandi II Not sure what it is I am doing wrong ...

Implementing an ADO.NET layer

Are there any tutorials or how-to's that explain how to implement an ADO.NET layer? That would include implementing a Connection class, etcetera. I need to do this because I am querying an old proprietary system and I want to wrap the old APIs properly. ...

List of DbConnection.GetSchema collection names?

When you call DbConnection.GetSchema you give it the string name of a collection you are interested in. I can't find a list of collections anywhere. Is the list of collections immutable or does it vary by database type (orcle, sql server, etc.)? I'm interested in getting a list of all collection names in a few database types such as sql...

C# Application - Should I Use Stored Procedures or ADO.NET with C# Programming Techniques?

I have a C# Application I am creating that stores all data in SQL Server. Sometimes it's easier for me to make data changes programmatically and sometimes it's easier to have stored procedures and functions in the SQL Server database and call them. I am rather new to programming and I don't know what the subtle advantages and/or disa...

ADO.Net : Get table definition from SQL server tables

I am using C# to write a method that returns the following information about a table: column names, column types, column sizes, foreign keys. Can someone point me in the right direction on how to accomplish this ? ...

Long Running Stored Procedure from ADO.NET or Classic ADO

Assume the Stored Proc takes 10 minutes to run and returns no data. What is the proper way to call a stored procedure in SQL Server and have your code not wait around for the result? Is there a way to handle it from the T-SQL or the connection? Something that works in ADO.NET and classic ActiveX ADO? The only way I thought of is: 1) Cr...

How do I get the SqlDbType of a column in a table using ADO.NET?

I'm trying to determine at runtime what the SqlDbType of a sql server table column is. is there a class that can do that in System.Data.SqlClient or should I do the mapping myself? I can get a string representation back from SELECT DATA_TYPE, CHARACTER_MAXIMUM_LENGTH FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_CATALOG = '{0}' AND T...

SQL server ADO.NET over low bandwidth TCP/IP connection any tips/experience ?

Hello we have an SQL server application running over a low bandwith connection. We use ADO.NET. I was wondering if anybody has any tips on minimizing traffic over the channel. Im looking for answers on ADO.NET/SQL-Server specific tips that make it more efficient. Not obvious answers like "dont fetch many records". En example for MySql...

Can you parameterize sort order in a sql server prepared statement?

I've got a .Net web system with a VB.Net front end talking to a SQL Server 2005 back end over ADO.Net. Essentially, what I want to do is this: Dim command As SqlCommand = New SqlCommand("", connection) command.CommandText = "SELECT * FROM someTable ORDER BY orderValue @SortOrder" Dim sortParam As SqlParameter = New SqlParameter("@SortO...

Does SqlDataAdapter.Dispose actually Close an associated SqlConnection?

Does anyone know if the SqlDataAdapter.Dispose method actually closes or disposes any SqlConnections? I loaded up Reflector and I see that SqlDataAdapter inherits from DbDataAdapter. If I disassemble and look at the dispose method in that class, there appears to be no disposal of any SqlConnections. I suppose I could write a test for ...

Is there any concept like RDS(Remote Data Services) in .net ???

Is there any concept like RDS(Remote Data Services) in .net ??? ...

Any SQL Server multiple-recordset stored procedure gotchas?

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

Defining an Entity Framework 1:1 association

I'm trying to define a 1:1 association between two entities (one maps to a table and the other to a view - using DefinedQuery) in an Entity Framework model. When trying to define the mapping for this in the designer, it makes me choose the (1) table or view to map the association to. What am I supposed to choose? I can choose either of ...

ADO.NET Entities Framework Performance Tips Every Developer Should Know

What are the performance tips that every ADO.NET EF developer should know about? Please put each tip per answer and explain why the tip is good (e.g. by minimizing DB roundtrips). ...

Add ado.net data tables to a blank MDB file

I'm wondering how to add several data tables that I've built in code, to a blank MDB file that ships with my app. I find it easy enough to connect to the MDB file via the OledbConnection object, but then I'm at a loss for an easy way to add my tables to it. There it sits...open...and empty, but what next? I can add my tables to a datas...

How to return multiple records from multiple tables bu a single stored procedure having parameters?

Suppose my stored procedure is: IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'sp_QB_descriptionwise_select') BEGIN DROP Procedure sp_QB_descriptionwise_select END GO CREATE Procedure sp_QB_descriptionwise_select ( @description nvarchar(max) ) AS declare @type int SELECT Question.questi...

How do I convert a DataTable to an IDatareader?

We all know that DataReaders are quicker than DataTables since the a DataReader is used in the construction of a DataTable. Therefore given that I already have a DataTable.... Why would I want to convert it to a DataReader? Well I am creating an internal interface called IDataProvider. This interface is intended to be implemented both ...

Anyone have any opinions on DataTable.Load(DataReader) method?

Does anyone have any thoughts on this method? I have did some performance testing on it and it seems to perform worse than simply doing a dataadapter.fill call or just looping through the datareader and creating new rows for the table. Do people use this in production, or is this just another thing Microsoft gave us that we don't use? ...

Is there a bug in SqlDataReader.HasRows when running against SQL Server 2008?

Take a look at these two queries: -- #1 SELECT * FROM my_table WHERE CONTAINS(my_column, 'monkey') -- #2 SELECT * FROM my_table WHERE CONTAINS(my_column, 'a OR monkey') -- "a" is a noise word Query #1 returns 20 rows when I run it in Management Studio. Query #2 returns the same 20 rows, but I also see the following in the Messages t...

The timeout period elapsed prior to obtaining a connection from the pool.

I'm getting this error every few days. I won't see the error for a few days then I'll get a flurry of 20 or so all with in a minute or so. I've been very thorough going throw my code so that I'm using this basic setup for my DB access. try { myConnection.Open(); mySqlDataAdapter.Fill(myDataTable); myConnection.Close(); } Catch (E...