ado.net

ADO.NET Entity Framework: Best way of creating generic interface for business entities?

Hi, I am just getting started with the ADO.NET Entity Data Model and I was curious as to what was the best way of extending my entities behaviour. Say I have a table called "Customers" and I create an entity model based on this table. I now have a "Customers" entity class. I want to now add some methods to this class and also make it i...

SQL database differences.

Hi all, I have there 2 codes on how to connect to SQL Server 2005 database. code 1 are using Dataset, and Dataadapter, code 2, didn't used neither. Can anyone please help me explain what is the differences and advatages/disadvantages on both programs..thankz code1 //create connection, dataset, dataadapter System.Data.SqlClient.SqlCon...

How do you use ADO.NET to create a data source rather then read and manipulate one

I'm writing a plug-in for another program that generates a fairly complex tree structure of objects. The users will need to export this data from the plug-in for analysis and reporting. I definitely want them to be able to export to an MS Access database as it would be the most accessible for them to create quick and clean reports. But I...

Is it a good idea to re-use ADO.NET command objects?

I'm working on a .NET program that executes arbitrary scripts against a database. When a colleage started writing the database access code, he simply exposed one command object to the rest of the application which is re-used (setting CommandText/Type, calling ExecuteNonQuery() etc.) for each statement. I imagine this is a big performan...

ADO .NET Data Services for dummies

I'm taking another project currently, which is based on the ADO .NET DS, and I need to get into the topic as quick as possible. What is the purpose of ADO .NET Data Services in simple words? What is the best resource explaining ADO .NET Data Services? ...

SQL Server select and insert issue

Hello everyone, I have two databases called DB1 and DB2 on the same database server. I have Table1 in DB2 and Table2 in DB2. Currently, I am using insert into select * to transfer all data from Table2 into Table1 (Table1 is empty, my purpose is to make a copy of data from Table2 to Table1). The table structure is clustered ID column (of...

How do i connect to a SQL database from C#?

I am trying to write a local program management and install system for my home network, and i think i've got the technologies nailed down: C#/.NET/WPF for the client Lua for installation scripting support (through LuaInterface) SQL Server Express for maintaining a database of programs However i'm unsure what specifically i'll use to ...

How can i optimize subsequent related queries by using rowid

Hi, i am using ExecuteOracleNonQuery and getting rowid as output parameter.How can i optimize subsequent related queries by using rowid? ...

How do i extract data from a DataTable?

I have a DataTable that is filled in from an SQL query to a local database, but i don't know how to extract data from it. Main method (in test program): static void Main(string[] args) { string connectionString = "server=localhost\\SQLExpress;database=master;integrated Security=SSPI;"; DataTable table = new DataTable("allProgram...

Custom authorization in ADO.NET Data Services

I have an ADO.NET Data Service that exposes an Entity Framework data model (.edmx). I need to allow / reject reads/writes to certain entities for certain users. I use Windows Authentication. All I could find is overriding the OnStartProcessingRequest : protected override void OnStartProcessingRequest(ProcessRequestArgs args) { base...

Customize ADO.NET Data Service Exception

Is it possible to have a DataServiceException pass along a list of errors to consumers? Rather than just receive the standard Message, Stacktrace information I would also like to have a list of errors when various validations fail on a model. I tried to set the DataServiceException's inner exception to FaultException. [DataContract] p...

Creating a SQL Server table from a C# datatable

I have a DataTable that I manually created and loaded with data using C#. What would be the most efficient way to create a table in SQL Server 2005 that uses the columns and data in the DataTable? ...

existing application, can I just start using linq-to-sql? any tips on integration?

Hi, I have an existing web app that has a data layer and a bll that calls the data layer. The data layer is ado.net that calls stored procedures. I created another project in vs.net for linq-to-sql, dragged all my tables over. Would it be wise to just start using linq or should I spend the time and re-write all the db logic in linq ju...

.NET System.OutOfMemoryException and AppDomains

Hi, I have a plugin manager that launches a plugin which connects to a FoxPro database through the ADO.NET OLE DB provider. At one client site connections are opened and closed without any problems but at another client site, it gets stuck in 'connection.Open();' and within a couple of seconds over 1GB of memory is allocated. With...

C# - What are Some High Performance Best Practices/Tips for ADO.NET

I decided not to use an orm and going to use straight ADO.NET for my project. I know I know its gonna take longer to program but I just want pages to load at high speeds even at peak time. ...

timeout setting for SQL Server

Hello everyone, I am using VSTS 2008 + ADO.Net + C# + .Net 3.5 + SQL Server 2008. I am using ADO.Net at client side to connect to database server to execute a store procedure, then return result from the store procedure. Here is my code. I have two issues about timeout, If I do not explicitly set any timeout related settings, for the...

Insert server datetime using a SqlCommand

I have a SqlCommand which inserts a datetime into column using a SqlParameter. At present I use DateTime.Now as the value of this parameter. I believe this will add the datetime on the user's PC which is not consistent. How do I change this so the datetime of the database server is inserted? EDIT: I should have made it clear this wa...

Insert Records into Sqlite DB using ADO.NET Entity Framework?

I'm tring to insert some records into my Sqlite database using the Entity Framework. I do not have a problem connecting to the database or mapping to the database. At least, I don't think I do. When I call "SaveChanges" an exception is fired that states: Unable to update the EntitySet 'RawReadings' because it has a DefiningQuery and ...

Can not find out the function for stored procedure in Entity Framework

Based on a database myDB, I generate edmx for all table and compile the project. Then I create stored procedure myProc in myDB. Then I update the model by "Update Model from database" in the node Stored Procedure and add myProc. It is fine. Then "Create a function import" on myProc. It is fine. Then I compiled the project, it is fine. ...

Trigger not launched from interface

Hello: I have a table with an after update trigger in SQL 2005. If I update directly with SQL QUERY the trigger runs ok. This table is connected using a dataset and tableadapter to a DXDBGrid (Dev. Express). If the user updates the grid, the underlying data is updated, but the trigger is not launched. I've a PK on table, auto-generat...