ado.net

What are the security risks of depending on Hidden fields in a webpage to edit db records?

I am currently building a very small/simple web application in ASP.NET MVC with ADO.NET Entity Framework. I hit the wall doing an edit of one record in the database where I had to include the unique id (primary key) inside the html as a hidden field. This was One Possible Solution based on a question I asked here. I am afraid this m...

C# Silverlight Datagrid - ADO.Net Data Entities CRUD?!?!

Hello! I have followed this tutorial which allowed me to create a Silverlight Datagrid that pulled back data from an SQL Server Database. My next step is to be able to perform CRUD on this set of data (hopefully via the datagrid by simply editing the fields for update etc. and having this post back). I have been informed that the datagr...

When I Insert Rows into a SQL Server 2005 Table will the order be preserved?

When I select a series of rows from a sql server 2005 table using an "order by" clause and then insert them into a different (and empty) sql server 2005 table can I count on the rows staying in the same order. The reason I am asking is that I want to manipulate the rows using ADO.net. I want the rows in a specific order to improve th...

Converting XML to a DataTable

This is something I will be able to do, but I'm curious to hear people's ideas about the best way to do it. I have an XML file sitting on the web at http://www.someplace.com/file and I am writing a web service that will take that data and convert it to a DataTable object, then return the datatable. We're using c# 3.5. What do you think i...

Can a datatable cell contains a datatable ?

If not which structure should I use ? ...

Why does Entity Framework not return a trimmed string for a nvarchar(MAX) field?

I'm currently working on a Silverlight application connected to a SQL Server 2008 Express database that is largely based on a demo on Brad Abrams' blog. (NOTE: The demo file at the specified link is actually a different solution that the one he shows on the live running application. The demo in the blog post uses Entity Framework, whil...

How to put double quotes in ADO.NET query?

I am trying to prevent any SQL injection in all my queries and would like to know how to put double quotes in this query. Thanks string.Format("SELECT TOP 10 article_guid, article_title FROM article WHERE article.article_isdeleted = 0 AND FREETEXT(article_title, @val)"); ...

How to update all the autoincrement columns in a DataTable?

I have a DataTable with an "Id" column, which is an identity column in our SQL Server 2005 database. This column has the AutoIncrement property set to true. I don't fill the table with data from the DB, since I use it only for inserts, so it assigns bogus Ids starting from 1. But after I call the tableAdapter.Update(), I'd like to have ...

EF: load references after the context was disposed?

Hello everybody. I'm struggling with the ADO.NET Entity Framework. This is my ER-diagram: --------------------- ----------------- --------------- | GrandParentEntity |<-------| ParentEntity |<-------| ChildEntity | +-------------------+ 1 N +---------------+ 1 N +-------------+ | Id | | Id ...

ado.net entity framework delete rows

Hi, I may be completely blind and stupid, but I cannot find any method generated by ADO.NET Entity Data Model that would somehow delete rows from my table. I didn't want to create a custom query. So how do I do that? Please help. I don't have the method DeleteOnSubmit... don't know why. This is the code I wanted to use. var deleteOrder...

How to determine size property for stored procedure output parameters in C# data access layer

I've made a data access layer modeled shamelessly off of Castle Project's ActiveRecord implementation. In order for it to gain acceptance, it must support the extensive library of stored procedures in use at my organization, which have been written to use every input/output structure imaginable, including return values and output paramet...

Can I retrieve the provider if I have a connection object?

Given a connection object (or series of them), does anyone know of a way to backtrack and get the provider name? I'm trying to create a generic dataset generator that someone could load up with n DbCommand instances populate the dataset without requiring any further information. Theoretically, as a command requires a connection object,...

Use of AcceptChanges with SQL Server

I'm confused as to the effect of using AcceptChanges within a dataset. It appears from my tests that this forces the database changes to be comitted, disregarding any constraints on the database. Can anyone confirm if this is the case, or if not, how this differs from using the Update function on the dataset? ...

Is there a generic way to create a data source from a DataSet?

I'm working on an application that generates a ADO.Net DataSet, which I want to be able to export to various data source types. I'd like to keep my export code generic so that I could switch between exporting to an MS Access file, SQL Server, MS Excel or other data source types with out creating a lot of duplicate code. DbProviderFactor...

OracleClient to devart dotConnect for Oracle

Has anyone tried migration from Microsoft OracleClient to dotConnect for Oracle? Is it realy so easy (as they wrote at their blog http://www.devart.com/blogs/dotconnect/?p=67) or just another marketing trick? I've tried ODP.NET, but it seems to me that its interface differs from the standard one. ...

Error When Add new DataColumn in DataTable?

how to add new column in new DataTable But Erorr private void LoadtoList() { SqlDataAdapter sa = new SqlDataAdapter("SELECT * FROM EmpSign", _constr); dt = new DataTable("CCTVTable"); sa.Fill(dt); dtpass = new DataTable("CCTVpassword"); SqlDataAdapter sa2 = new SqlDataAdapter("SELECT PASSWORD FROM Emp e WHERE e.EmpI...

Serializing fields in a custom DataSet to XML

Is there any way to add fields to a DataSet which will be serialized along with the table information when the DataSet is serialized in XML? I have some information that describes the DataSet that I want to try to include inside it when I throw it around in XML. I've tried adding fields and classes in the partial class Visual Studio gene...

ADO.NET |DataDirectory| where is this documented ?

In AppConfig it is possible to use |DataDirectory| but I can't find any doc ? ...

Best way to establish a connection for use with an ADO.NET command object

I'm designing a web service in ASP.NET and VS2008, and am using typed datasets for retrieving table data. These work well and establish their own connections through their associated TableAdapter objects. Edit: I'm using VB, BTW! I am now attempting to run a custom SQL string using a DataAdapter and a Command object, however I need to r...

Bogus InvalidOperationException (in a DataServiceRequestException)

I am having a hard time with ADO.NET Data Services (formerly code-named Astoria) as it gives me a bogus exception when I try to insert a new entity from the silverlight client and trying in a clean project (the same code) doesn't. In both cases, however, data is correctly inserted into the database. Using Fiddler (an HTTP debugger I cou...