ado.net

getting returning value from a stored procedure in postgres

Hi. I have a stored procedure in pqsql: CREATE OR REPLACE FUNCTION dosmth() RETURNS boolean AS $BODY$BEGIN RETURN FALSE; END;$BODY$ LANGUAGE 'plpgsql' VOLATILE From ado.net i need to retrieve the return value. I try to do the following. DbCommand cmd = DBTemplate.CreateStoredProcedureCommand(dbConnection, "dosmth"); cmd.Pa...

Where to find .Net ORMs comparison with numbers or charts?

Where to find .Net ORMs comparison with numbers or charts? I am building a new websites, will work on arranging images and manipulate images online, so it will contain a lot of images, and sure many images make the website pages load slower. So the speed of the data access layer very important for me, and i am searching for an ORM beca...

ADO.NET: Need help to understand the basics of 'Dataset'

Dear Helpers As context, I am new to ADO.NET and have been using 'Programming ADO.NET 2.0' by David Sceppa to help build my knowledge. I have been trying to understand the Dataset object but think I may have completely misunderstood the point and am looking for guidance. As an example, I have built a really simple Form with a combobo...

Generic way to determine if a column exists in ADO.NET

I'm using the 2.0 framework and I'm looking for a generic way to determine if a column exists in a table. I want to use this code with multiple database types and providers. The GetSchema method will return schema information but the format of the information and the data to restrict the information returned both seem to be specific to...

ADO.NET: DataSet or DataTable and how to retrieve data

SO community I am getting started with ADO.NET and am fairly new to programming. I have had some support already from this community which has been very useful and had another question. In simple terms, I am creating a simple windows form with a combobox of employee names and a button so that when the user clicks the button the select...

Difference between recordset and sqlreader

Difference and similarities between recordset in asp and datareader in asp.net ...

Why is my SqlCommand returning a string when it should be an int?

I have a query that should always be returning a single int. I have now logged it returning a string entirely unrelated to what it should be. We've been getting some random FormatExceptions that we've tracked down to several database queries. After some additional logging, I found that, this morning, the query below returned the string ...

Copying large amounts of data into a SQL CE database

If I have a large amount of data in memory, what is the best way to copy it into a SQL CE table? The current technology stack is C#, ADO.net, and SQL CE. My initial idea was to do one INSERT statement for each row of data, but this is time-consuming. Is there an easier way? ...

Web Service Out of Memory Exception while filling ADO.Net DataSet

1) ClientApp makes async call to ASP.Net 2.0 WebService 2) Web service calls SQL Server 2005 stored procedure 3) Stored procedure returns data output, 150MB table Out of Memory Exception is thrown by DataAdapter.Fill(...) while trying to allocate more memory for new rows. IIS Application Pool does not have any Max Memory restrictions o...

SqlConnection - is remote or local connection?

How can I determine is it local connection (localhost or 127.0.0.1) or is it remote connection (other machine in local area) if I have SqlConnection object? ...

how to convert data efficiently in DataTable in ADO.Net

Hello everyone, I am using ADO.Net + C# + VSTS 2008 + SQL Server 2005. I bind an ADO.Net DataTable to a real database table, and then bind the DataTable to a grid view on ASP.Net page. My question is, if I want to do some data manipulation work (very simple, like add some prefix to some character data type rows, multiple integer data ty...

connection string of ADO.Net of SQL Server

Hello everyone, I am confused about the connection string format of ADO.Net when connect to a non-default instance of SQL Cluster. I did search but find various samples, could anyone let me know what is the correct format please (if I know the virtual server name and instance name)? I am using trusted connection. thanks in advance, Geo...

Can you include linq-to-sql changes and ADO.NET dataset table adapter updates in a single transaction?

Here are the relevant technologies that I'm working with: Devart's dot Connect for Oracle (to facilitate Linq-to-Sql for Oracle). Strongly Typed ADO.NET Datasets. An Oracle database. Here's the challenge: My legacy code submits database updates with ADO.NET datasets and table adapters. I'd like to begin converting that code over to...

How to save an arbitrary DataTable to a new SQL Table

Suppose I have an ADO.NET DataTable that I was to 'persist' by saving it to a new table in a SQL Server database - is there a fast way of doing this? I realise I could write code generating the DDL for the 'CREATE TABLE' statement by looping through the DataColumns collection and working out the right type mappings and so on ... but I'm...

Number of total select statement for particular web page?

I was wondering what is the easiest way to see total number of database queries from my ASP.Net (.NET 2.0) application. My application heavily use sql 2005 database because all data are dynamic and everything goes through one connection string in web.config. Connection pooling is enabled there. So, I am wondering how many select stat...

How do I implement a Peek() function on a DataReader?

There doesn't seem to be a Peek method on the DataReader in ado.net. I would like to be able to perform some one-off processing before I loop through my reader, and it would be nice to be able to look at the data in the first row without causing it to be skipped by the subsequent iteration. What is the best way to accomplish this? I am ...

How Do I Get the Selected DataRow in a DataGridView?

I have a DataTable bound to a DataGridView. I have FullRowSelect enabled in the DGV. Is there a way to get the selected row as a DataRow so that I can get strongly typed access to the selected row's values? ...

Can I run DBCC CHECKDB from .NET?

I am writing a scheduled job to mimic a SQL Server maintenance plan for SQL Express. (I have to do this because SQL Agent and related tools don't exist for SQL Express) One of the steps is to do a database integrity check. The TSQL for this is: DBCC CHECKDB(N'Northwind') WITH NO_INFOMSGS How do I know if an error occurred during ex...

SQLCacheDependency with ADO.NET Entity Model

Does SQL Cache Dependency work with the ADO.NET Entity Model? Please give me some example link of something. ...

Is there a way to test a potential zombie transaction to see if it can be rolled back?

If a sql call fails, say to timeout due to deadlock, the transaction can turn into a zombie transaction-- I guess either my code or framework code does the rollback. The SqlTransaction isn't null, but it is a zombie can throws an error if you try to do a Rollback(). I can't find the .IsZombie property. // Make sure the transaction is ...