ado.net

How to stop a query on in an oracle data base

We are using oracle > 10.0 here and our software creates different types of reports for evaluation of the stored data. Because of the amount of data it is possible that such a report takes a couple of minutes to create and the customers would like to stop the queries. Is there a way to say the DMBS that it should stop a query? It would ...

Trying to add a parameter to my sqldatasource during rowDataBound

So I have a gridview within a gridview (I have a one to many table) my first gridview is working well, but my second gridview has a sqldatasource that has a select parameter(the default value was just for testing) <asp:SqlDataSource ID="dsCountryByTripID" runat="server" ConnectionString="<%$ ConnectionStrings:bahDatabase %>" ...

Using Command Text in EntityDataSource control

Hi, In my case I have to fetch data from two table so, inspite of using a select property.. I am using command Text..but on running it throws error: 'dbo.InvestorSectors' could not be resolved in the current scope or context. Make sure that all referenced variables are in scope, that required schemas are loaded, and that namespaces are...

Repeater within a Gridview - Repeater only pulling from the last gridview ID(causing each repeater to be the same)

I have a gridview that displays all trips - within that gridview I have a repeater that displays the countries visited during that trip (one to many). My repeater is suppose to grap the tripID and then populate the datasource, which populates the repeater. Unfortunately, my repeater is just being populated with the last tripID specified...

LINQ-SQL & ADO.NET - How to make a bulk transaction entirely asynchronous?

Hi Guys, So i'm dealing with an ASP.NET 4.0 Web Forms Application in which the DAL is built with a combination of LINQ-SQL and classic ADO.NET (for auditing transactions, and bulk updates). I have an admin page on the site which performs an update on a bunch of records (could be thousands), and not to mention there is T-SQL triggers in...

SQL Server connection arbitrarily returns 233 or 18456 error codes

While trying to test an invalid connection string against a SQL Server 2008 Express instance, I found this weird behavior: specifying an invalid Initial Catalog raises an SQLException whose Number is sometimes 233, and sometimes 18456. Code may illustrate it better. // The following connection string has a purposely incorrect initial c...

What is the relationship between open SqlConnections in the client app and processes in SQL Server?

I just tried to make a simple schema change to a table in a SQL Server database (by using the Design tool in SMSS). Whenever I tried to save the change, it kept timing out. I wondered whether this was due to existing connnections which were 'locking' the table. I decided to kill connections as an experiment. I queried master..sysprocess...

Sqlcommand Parameters not executing

I am encountering a strange problem when attempting to execute a DELETE query agains a SQL Server table using VB.NET, SQL Command, and Parameters. I have the following code: Try sqlCommand.Transaction = transaction1 sqlCommand.Connection = conn sqlCommand.CommandText = sqlQuery sqlCommand.Parameters.Add("@userID", S...

Does MySQL Connector/Net translate my inline SQL into code?

Maybe this is a dumb question, but I don't know the answer. If I use MySQL Connector/Net, when I send SQL via ADO.NET, does my inline SQL get translated into code first and then sent to the database, or does it get sent as SQL text, and then the database engine has to translate it into code? Or doesn't ADO.NET do a translation? Or, if...

Invariant names for different ADO.NET providers

For a proposed change in NHibernate drivers to make it easier to build and deploy NHibernate-based solutions (see this thread) we need to collect the invariant provider names of the following RDBMS: Adaptive Server Anywhere DB2 Firebird Ingres MySQL Oracle SQLite SQL CE Sybase You don't need to know all of them to answer this questio...

how to iterate through reader for notnull without repeating code over and over

First off, I am new to programming (especially with C#) and thanks for your help. I have a static web form with about 150 form objects (most checkboxes). I decided to go 1 record per form submission in the sql db. So, for example, question X has a choice of 5 checkboxes. Each of these 5 checkboxes has a column in the db. I have the pos...

ADO.net reference loading in Property

I have the following problem. An object has an address, and this address has a country. To fill a dropdownlist with the available countries in the DB I use a property in the partial class of the object: public string CountryID { get { return this.Addresses.Countries != null ? this.Addresses.Countries.ID.ToString() : null; } ...

ADO.NET Insert Min Value into SQL Server 2008 Date column crashes

Hi, I'm trying to do the following: using (var tx = sqlConnection.BeginTransaction()) { var command = sqlConnection.CreateCommand(); command.Transaction = tx; command.CommandText = "INSERT INTO TryDate([MyDate]) VALUES(@p0)"; var dateParam = command.CreateParameter(); dateParam.ParameterName = "@p0"; dateParam.DbType = DbType.Dat...

insert data to db in loop performance

Hello, I'm trying to write Windows app to get data from From Fox Pro DB, and inset it to Sql Server 2008 db. I wrote code, but it works very slow. rowsCount more than 1 million My code below: OleDbConnection cn = new OleDbConnection(foxProConnectionString); SqlConnection cSql = new SqlConnection(sqlServerConnectionString); cSql.Open();...

Dataset vs. Returning a Datatable

I have created alot of stored procedures in my application that return the result of a query in a datatable object. I never use a dataset. Why would I ever use a dataset over simply returning the result of a query as a datatable object? ...

is there a factory method that can create a DbDataAdapter given a DbCommand or DbConnection?

i want to create a data access layer that work with any provider. its possible to create a DBCommand using the factory method objDbCon.CreateCommand(). but couldnt find anything to create a DbDataAdapter , so how come? is this is a bug in ado.net or what? ...

Copying all records from one dataTable to another

How can I with ado.net copy all rows from one DataTable (srcDataTable) to another (destinationDataTable), if: DataColumns names are identical; DataColumns can be in another order in destinationTable; if any DataColumn doesn't exist in destinationDataTable, don't insert data into cell in this column. Thanks. ...

Select a data from MS SQL Server 2005

I have a table named t_Student in Microsoft SQL Server 2005 database. In that table there are three columns named student_regiNo, student_Name, student_Email. I'm using following code segment to retrieve "student_Name". But instead of showing "student_Name" it shows "System.Data.SqlClient.SqlDataReader". Whats the problem? private ...

ADO.Net Entity Framwork 4 CTP POCO Mappings Error

We are starting on a new version of our product and decided to use POCO objects with EF while keeping backwards compatibility with the existing databases. The problem is that i have a credit card object with a property BillingAddress that is of type Address. In the new database model all address are stored in the address table, in the ...

Silverlight ADO.net entity Data Model error

I'm trying to consume a WCF Data Service in a Silverlight App using an ADO.Net Entity Data Model, however I keep running into this error: The content type text/html of the response message does not match the content type of the binding (application/soap+xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSuppor...