ado.net

Firebird .NET provider and ASP.NET

I have no problems setting up a regular (Windows Forms or Console) project in C# to use Firebird's .NET data provider. However, whenever I try to use the same provider in ASP.NET I do the following: Copy the DLL to the project to keep it under version control Add the reference to the project Create an entry in <connectionStrings/> tag...

TableAdapter of Strongly Typed dataset won't let me generate the Update method

I have a view from my database being represented as a TableAdapter, but I cannot get it to generate the Update methods. The, "Create methods to send updates directly to the database (GenerateDBDirectMethods)" is grayed out. How can I enable this? Or will I have to do this manually? ...

Improving performance with a Crystal Report containing a subreport?

Does anybody know how to improve the performance of a Crystal Report that has a subreport? The subreport uses ADO.NET objects...and takes FOREVER to generate. ...

using sql server 2005 synonyms for table causes dynamic query generation errors

Hi, I have a situation where by i have a catalog on Server A, and a same named Catalog on Server B. I'm using synonyms on Server B so that some tables are actually just going through to server A. Such that, calling select * from ServerB.Table, is actually returning Data from ServerA.Table transparently. This seems to work fine when ...

Is there a way to close all connections in the pool for the SqlClient provider

I would like to close all idle connections in the SqlClient connection pool. Is there a documented method for doing this? The issue is that as part of the normal processing of this application (A testing harness) I need to drop the database and recreate it at the start of each test scenerio. Obviously I can't drop the database with ac...

ADO.NET Entity data model with oracle

Is it possible to create ADO.NET Entity data model with oracle in VS 2008? If not what should i use? ...

c#: Programatically call a TableAdapters.Fill Method using a string to Specify the TableAdapter

Greetings Guru's I have a peculiar problem with TableAdapters and the Fill Method. I have a bunch of autogenerated TableAdapters as a result of binding an app to a DataSource. They are bound to controls on my form and work as expected. Now I need to call the fill method on the TableAdapters from time to time and I want to do It program...

Sharing Data Between User Controls

How do I share data between user-controls in .Net, using ADO.net datasets, without ditching the designer? A simple example: I have two separate user-controls; Control1, which contains a textbox, and Control2, which contains a label. Both the textbox and the label are bound (using the designer) to the same property in the same datase...

How to do a left outer join wtih an include in sub query?

I have a table which I am querying via Entity Framework: using (Entities context = new Entities()) { var customizations = context.Customizations.Include("aspnet_Users").ToList(); } However, I want to included another table, "SelectedCustomizations" as a LEFT OUTER JOIN into the above query. Any ideas? ...

Error: Time-out interval must be less than 2^32-2. Parameter name: dueTm

I have a one-to-many relationship within my class model. Example: A single role can have many permissions attached to it. so have two table one from the role and one for the permissions for each role. Now i have a role class which in turn has a permission list as a member of that class. When i need to do an update, i instantiate a tra...

How do i properly insert a tag? SQL

example tag { id PK, name TEXT }; item { id PK, exampleData LONG, tagId LONG //or foreign key depending on provider } i'm using SQLite and C#. Is it proper to Start a transaction Insert into tag If affected rows = 0 do a select to get tag.PK otherwise use last_insert_rowid Insert item or will there be a problem with the above? I ...

Pass an array as value in an ado.net DBParameter

The project I'm working on has a lot of IN-queries like: SELECT something, anotherthing FROM atable WHERE something IN (value1, value2, value3) This is an example of a queru with 3 parameters in the IN-part but the same query could be executed with 1 or 2 or 5 or 10 or ... parameters. The problem is that each query has an other execut...

Use EntityFramework to save Items (with new elements in multiple tables) after being sent over WCF to a silverlight app

I have a web app that sends ADO Entity data model classes over a WCF service to Silverlight. Imagine this simplified structure for the database [Item] Id Name [ItemDetail] Id ItemId value While the Item is in my SilverlightApp I add an ItemDetail to the Item, this is ADO so it's something like: var fv = new ItemDetail(); ...

datacoloumn in asp.net

I first want to add a database column in DataColumn..and then i have to add datacoloumn in datatable.. please guide me; SqlDataAdapter d2 = new SqlDataAdapter("select MARK_PARTA from exam_cyctstmarkdet",con); DataColumn c = new DataColumn(); c.ColumnName = "parta"; c.DataType = System.Type.GetType("System.Int32");...

Query Multiple databases with single ado.net query

I have distributive DB architecture where data is stored in multiple SQL servers. how can i do select/update/delete by running a single query. for example "select * from employees" should return data from all databases i have. How can write single query which run across multiple SQL servers and gets a single consolidated view to my we...

Asp.Net: Returning a Reader from a Class

Hi all, I was just wondering about the correct way to return a reader from a class? My code below works, but I'm unsure if this is correct. Also. I can't close the the connection in my class method and still access it from my ascx page, is that OK? // In my class I have the following method to return the record/reader -- it's a si...

Creating table relationships in SQL Server via C#

Hi, I want to create relationships in my SQL Server database using C#. I have this code: foreach (ForeignKey fk in table.ForeignKeys) { if (!table.ForeignKeys.Contains("ProductMaterial")) } table.ForeignKeys.Add( new ForeignKey( ...

List of SQL Server errors that should be retried?

Is there a concise list of SQL Server stored procedure errors that make sense to automatically retry? Obviously, retrying a "login failed" error doesn't make sense, but retrying "timeout" does. I'm thinking it might be easier to specify which errors to retry than to specify which errors not to retry. So, besides "timeout" errors, what o...

ADO.NET SqlClient connection string - Data Source syntax

Is there any official write-up what forms can Data Source field take in sql server connection string? I'm aware of following forms: SERVER SERVER\Instance tcp:SERVER,port nb:SERVER nb:SERVER\Instance are there more forms? EDIT: The essence of this exercise is not to construct a connection string. I am trying to parse existing connect...

Testing custom ORM solution performance overhead - how to?

I have created a prototype of a custom ORM tool using aspect oriented programming (PostSHarp) and achieving persistence ignorance (before compile-time). Now I tried to find out how much overhead does it introduce compared to using pure DataReader and ADO.NET. I made a test case - insert, read, delete data (about 1000 records) in MS SQL S...