ado.net

Entity Framework: Metadata when Entity Name is Same as Property?

I have a EDM with a entity "Extensions" - within this object is the property extension. I've wired up all the other columns just fine, but this one refuses to wire up. I'm guessing because the entity and the property share the same name? Here is my code, the extensions doesn't work, the prefix does work: Imports System.Web.DynamicData I...

SQL Server timestamp column not supported in Mono?

I am trying to run a .NET command line application in Linux using Mono. It accesses SQL Server 2005 Express database and, when querying some data it throws the following exception: System.NotSupportedException: Unknown Type : timestamp at Mono.Data.Tds.TdsMetaParameter.GetMetaType () [0x00000] at Mono.Data.Tds.Protocol.Tds70.Write...

Entity Framework: Create Change History

I have a EDM (phoneDB) that models a back-end MSSQL database. I've developed a ASP.NET (VB) application that allows one to edit the information in this database. When someone edits a record entry I'd like to record this action. Right now, I'm doing the following: For Each..Next that checks whether entry is an object that has had its...

Entity Framework: How to update database when modifying Model

Hi In Entity Framework 4 there are the options "Update Model from Database" and "Generate Database from Model". But what I'm missing is an option like Update Database from Model which reflects the changes made in the model (e.g. adding a new Property or Navigation-Property) by modifying the database schema (e.g. adding a n...

Get Specific Value from entity.OriginalValues in EFv4

I have an ObjectStateEntry "entry". I need to get a property value from this "entry" like so, but I don't know how to specify the property I want. I use entry.OriginalValues(propName) but then what? ...

Entity Framework: Save Object?

Here is my code: Partial Public Class AppsEntities Private Sub OnContextCreated() AddHandler Me.SavingChanges, AddressOf context_SavingChanges End Sub Private Shared Sub context_SavingChanges(ByVal sender As Object, ByVal e As EventArgs) For Each entry As ObjectStateEntry In DirectCast(sender, ObjectContext).ObjectStateManager.G...

DataAdapter.Fill to specific table in dataset

I am trying to make use of DataAdapter, unfortunately stuck with straight ADO.Net, and all of the examples I see have a call like this: dataAdapter.Fill(dataSet, "TableName"); I want to do a fill in that manner, meaning the data goes into a named table, so that I can properly manage the tables later on in the cycle. Unfortunately, it...

ORM tool OR build the object to relational mapping layer manually

I am trying to determine what if any advantage or disadvantage there is to using an object to relational mapping layer like hibernate or the Microsoft Entity framework when building the data layer. Is using sql and mapping objects by hand better in the long run or is it better to leverage one of these mapping technologies? It seems ...

How should I read the data from different oracle schema using ado.net?

The database user has got two schemas. I need to read the data from a specific schema using ado.net. I am using OleDbConnection object to create the connection to database. Appreciate your answers. ...

Is it possible to store System.Decimal.MinValue and System.Decimal.MinValue in SQLite?

Considering that the maximum size of a data type supported by SQLite is 8 bytes, can I store a Decimal.MinValue, Decimal.MaxValue in a NUMERIC column. I am using the ADO.NET provider for SQLite by phxsoftware. Does the driver internally store the value as a string and do the conversion both ways? I do get a System.OverflowException whi...

How to add and reuse objects in a many to many relationship in Entity Framework?

I'm working on an asp.net-mvc project. I have an Items table and a Tags table. There's also an ItemTags table made up of two columns, setup as a composite key, storing Id's from the first two tables. Mapped to EntityFramework this latter table enables navigation between the tables. When i add a new Tag for a specific Item i use: db....

Manipulating FormView values pre and post bind/db operation?

Hi, guys. I have two FormView controls on an asp.net page using an EntityDataSource. I'd like to hook the ItemInserted event of the first one, get the identity field of the insert and use that identity in an insert call of the second. Is this possible? I figured I can get the identity from hooking the Inserted event of the EntityData...

DataBinding with entityframework bug

Hi, I have an application which consists of simple schema of DB: Networks 1-->* Shops i use entityframework (Default EntityObject Code Generator) with winforms, i use DataBinding to a grid to CUD these entities, i have : DbObjectModelContainer _context = new DbObjectModelContainer(); _context.ContextOptions.LazyLoadingEnable...

SQL Server 2008 copy table with changing physical sequence of fields

The task is to copy table1 ( A,C,B ) to table2 ( A,B,C ) Tables effectively identical, the same fields/constraints just physical sequence of fields is different. Can I do it with standard tools and minimal coding. For bulk copy in this case mapping for each field pair seems to be required. ...

Read data using ODBC ADO.NET from Db2 Codepage 1252 - Euro (€) Symbol is not retrived correctly

In VS 2005 C#, While inserting Euro (€) Symbol into Db2 table, It is storing values correctectly. DISABLEUNICODE=1 parameter helped to store this correctly. But when we try to read from the table, it is giving junk char as below. "Spec GS 1" Same code is working in VB 6.0 ADO Could you please help me. Code: OdbcConnection...

How do i get my Windows Azure Worker Role to connect to my Ado.NEt Entity-based db

I've built a backend in ASP.NET MVC2 which has an underlying ADO.NET Entity-based Database. In the MVC Backend, I call my database entities, i.e.: Entities entities = new Entities(); ...and that all works fine. Unforutnetly, in my Azure/mvc2 project, My worker role makes the azure project throw weird exceptions: "The specified name...

[entity framework] multiple edmx in the same .net solution

hi I have 2 project in my .net solution.each one has entity data model.how I can make an association between two entities one in the first project data model while the other in the second project data model in the same solution? what if each data model mapped to different database? ...

Problem reading large dot delimited strings from excel sheet column into dataset.

hi everyone, I am trying to read the content of an excel sheet using the following code. string tempExcelFileUploadPath="C:\\Documents and Settings\\......\\excelsheet.xls"; String excelConnectionString1; //connection string for excel sheet excelConnectionString1 = @"Provider=Microsoft.Jet.OLEDB.4.0;" + @"Data ...

Executing stored proc from DotNet takes very long but in SSMS it is immediate

I have a stored proc on SQL Server 2000 that takes 3 parameters. When I call the stored proc from DotNet using SqlCommand.ExecuteReader () it takes about 28 seconds. When I run the same query inside SSMS directly it returns immediately. When I take the query out of the stored proc and run it directly using DotNet it also returns immed...

ConstraintException on DataTable.Rows.Add with AutoIncrement Column

Hi, I've got some DataTables with an ID column with AutoIncrement enabled both on the MySQL server side and the ADO.NET schema side (loaded from an XML schema file). I'd like not to have to care about these IDs when inserting rows because their sole use is to have a primary key for the table – there are no foreign key references. Howe...