ado.net

In Sync Framework serverProxy.GetScopeDescription() fails during running the WebSharingAppDemo-CEProviderEndToEnd sample

I am running the WebSharingAppDemo-CEProviderEndToEnd saPLE WITH sqlExpress 2005 Beta as server and havin the SQl Express as Client. The Programs runs well till it reaches to SynchronizationHelper.cs class where it checks CheckIfProviderNeedsSchema(remoteProvider as SqlSyncProviderProxy); from there it tries to retrieve the scope descr...

How many connections are available in the ADO.NET connection pool

Is it possible (from a asp.net application) to check how many connections of the ADO.NET connection pool are currently in-use and how many are available (not currently in-use)? ...

Is there any way to use SqlTypes with a SqlDataAdapter?

I'm trying to write some simple C# code that will select some data from a SQL Server instance, modify the data, and update the changes back to the database. But I'm having a hard time figuring out exactly how to do this. Here is a simplified version of my code: using (SqlConnection conn = new SqlConnection("Server=(local);Integrated S...

Get column default values with ADO.NET

I want to get the default values of all columns of a table so I can display them in the data-entry form, is there a way to do this using ADO.NET ? I know I can query the information_schema database for this info, I'm just wondering if there's a built-in way to do this in ADO.NET ...

ADO.Net - Why isn't the insert happening?

I went through MSDN pages to learn ADO.Net using Commands. I am able to read using the sample code posted there. But when I tried to use the modification code below, the insert is not happening. I am not ale to figure out why. Can someone please tell me what is wrong with this code? string connectionString = "A_VALID_CONNECTION_STRING"...

directory of .sql file

hi,where is the directory that should we paste the .sql file to use(open,close) in ado.net i want to use a .sgl file in ado.net and i dont know that where should i paste the file that can use in ado ...

How do I cache a dataset to stop round trips to db?

I am creating a search results page in C# in an ASP.NET 1.1 page. In my data layer I have a DataSet that stores the result of a plain old ADO.NET stored procedure call. The DataSet has two DataTables and I'm using a DataVIew to filter and sort the columns. I only want to fill the dataset once, and then work on the DataTables and derived ...

ADO.NET Question: When to use DataReader, DataAdapter

Hi guys, i just wondering, what things i have to consider when using DataReader and DataAdapter in fetching data from the database and whats the difference between this two other the datareader needs open connection and the datadapter does not... In our projects, were using DataReader in ALL our DAL, we never use dataadapter. So I wonder...

Utilize ADO.NET within Classic ASP script

I'm writing some simple queries which return a single value and I'd like to get the ADO.NET ExecuteScalar method's behavior from Classic ASP's ADO libary. However, I'd prefer to not re-invent the wheel. Is it possible to instantiate ADO.NET's Command object within classic ASP? If so, how would I go about doing that? If I do need to re-i...

how to export ADO.net entity data model to a .mdf file?

Hi, I've created my first ADO.net entity data model. In it there are 2 tables (with no relations, just simple tables). In my Project's App_Data directory there is an (empty) mdf file called "trans.mdf". When I select "generate database from model" in the ADO.NET model, I can select my "trans.mdf" in the dialog. It then builds the dd...

How to serialize member functions of ADO.NET for use in RIA Services

I am new to using RIA services and the Entity Framework so this is probably very simple. I am trying to extend an entity class using a public partial class in a separate file. My goal is to simply override the ToString() method. Doing this is as simple as... public partial class ClassName { public override string ToString() {...

I cannot find template ADO.NET Entity Data Model in VS2010

Greetings, In VS2010, I cannot find the template ADO.NET Entity Data Model from the Data section. I was doing: 1. create a silverlight(version 4th) project with a WebSite 2. right click the web project, Add -> New Item -> Data Section(actually, I tried every one) But i cannot find it!! It's weird! Then, 1. I tried to reset my VS templ...

C# insert string to database issue

Hello everyone, I am using VSTS 2008 + C# + .Net 3.5 + ADO.Net + SQL Server 2008. I have some C# string type variables, and I want to insert them into database as type DateTime, any code samples? My problem is how to do the conversion from string to database DateTime type. thanks in advance, George ...

ADO.Net entity framework SQL loginPermissions

I am fairly new to entity framework, and i am planning to use it in my next project. what permissions should web give to the sql server user login which entity framework uses? since i read entity framework does DML operations do i need to provide datawriter role to login? ...

Using very long (10000+ characters) strings as SqlParameter value

Hi, all, I am trying to execute an insert command into the database and one of the columns is of type nvarchar(MAX). Insert command is created by using .NET SqlCommand class and each of the parameters is represented by one SqlParameter object. My command gets executed always, but when I pass string which length is large (10000+ charac...

How can I read the header of table in Excel and display it automatically on a ASP.NET MVC page?

Hello, (finally) I was able to read a Excel file located in the App_Data folder and display it on a view. Now I'd like to push the logical further. Instead of writing the following header tags on my page by hand, <tr> <th>ID</th> <th>First Name</th> <th>Last Name</th> </tr> I'd like to be able to read the first row on my...

RDO to ADO.NET - rdoErrors in Oracle

I am converting some code from VB RDO (using an ODBC cursor) to ADO.NET Some of the old VB code loops through the RDO errors collection to get any ODBC or Server errors and log them accordingly. I've converted the code using Data.Common objects (ex: DBCOnnection, DBCommand) and using Datasets and ODBC. (I am NOT using Oracle .NET Prov...

How do I obtain a list of all schemas in a Sql Server database

Hi, I want to retrieve a list of all schemas in a given Sql Server database. Using the ADO.NET schema retrieval API I get a list of all collections but there is no collection for 'Schemas'. I could traverse the 'Tables', 'Procedures' collections (and others if required) and obtain a list of unique schema names but isn't there a easier/s...

help with reducing the number of connections to the database

I have a list of strings that are just invoice numbers. I am enumerating through this list to get the details of each invoice from the database. This list can easily be 700 to 1000 in size. the way I am doing it now results in 700-1000 connections to the database. this is taking too long to complete is there a better way to do this tha...

MySQL Forcing a Computed Column to return as 32 Bit

Hello all, I'm running a C#/.NET 3.5 App that uses the MySQL .NET Connector (6.2.3.0) to return data from a 64 Bit MySQL Server running on CentOS 5. By and large, this works out pretty well. My problem is when I execute queries (procedures mostly) that contain SQL Like this: SELECT t.id AS ID ,COUNT(t.item) AS Ite...