ASP.NET MVC 4 data model column error - visual-studio-2010

I create new ADO.NET data entity model in visual studio 2010. Everything is okey .sql server column name is "tag" but in model column name is "tag1" or "category1". All column name end 1
sql table is normal.TagID is primary key and auto increment but why happend this stuation? thanks.

Related

How to use IDENT_Current function on multiple identity columns table

I want to get the latest inserted record from target table and update the field in source table.
Source:
Name company targetID
Jane YYYY Null
Basically, I am looping the files in SSIS and inserting the target tables via webservice(script task). Each record is created per file . I want to capture the latest ID created in target and update the source field.
Target:
ID name company
1 Jane YYYY
after the row is created in target for a file, I want my source to be
Source:
Name company targetID
Jane YYYY 1
If the row is not created ,then do not update source.
I checked for scope_identity(),ident_current but not sure how to use them in my situation as I am inserting target tables via webservice.
Also, my target table can have more than 1 identity column. How do I use Ident_Column on this table?
Any help is appreciated.

How to get added entity Id? Entity Framework 6 Oracle 11

I am using EF6 database first, against Oracle 11. the tables ids are generated by trigger using a sequence in the database.
When I add an entity through EF, the ID is not retrieved back as expected, any clue what is wrong?
using (var Context = new Context())
{
Context.DATASETS.Add(datasetToAdd);
Context.SaveChanges();
}
datasetToAdd.ID is not populated.
Ensure that the database column is IDENTITY, and that StoreGeneratedPattern is set to Identity in EDMX.

Oracle designer - table definition

I've added a new table definition to a project folder and then created a primary key, however when I click on the 'columns' to create a key component its telling me no mandatory columns are in the Table Definition - create one or more mandatory columns. I've gone back to table definitions but I can't see how I do this and then assign columns to the Primary key?
Any help appreciated!!

insert multi language text to database using entity framework

for inserting value to the table using entity framework I have used this:
db.FileWavs.AddObject(wav);
db.SaveChanges();
To insert foreign language text I used N in query in front of values:
INSERT INTO FileWav (Description) values( N'थिच्नुहोस' )
But How can I used it in above code of entity framework.
You don't need to do anything in entity framework, just make your field nvarchar() in database and you are done, then you can pass any UTF-8 without doing anything to entity framework.

Sql Server CE foreign key shows up as primary key

At least, that's how it looks to me. I'm using Sql Server CE 4.0 and Visual Studio 2010. This is the first time I've used Sql Server CE.
For example, I have two tables. One is called Templates:
TemplateID (int, primary key, identity)
TemplateName (nvarchar)
The other is called Products:
ProductID (int, primary key, identity)
TemplateID (int, foreign key relationship with Templates)
ProductName (nvarchar)
After creating these tables, I attempted to set up a foreign key relationship between the tables on the TemplateID field in Products and the TemplateID field in Templates.
After setting up the relationship, when I look at the Products table in the Server Explorer, I see that TemplateID has been flagged as a primary key in Products. This is NOT supposed to be a primary key in that table!
Is this simply some oddity of presentation for CE tables -- meaning the foreign key is a primary key in some other table? It doesn't seem so, because clicking on the TemplateID column in the Products table, and expanding the Identity tag in the Properties window, shows that the "Table" is Products, not Templates.
If anyone could shed light on this strangeness I would really appreciate it.
Some testing confirmed that the foreign keys are NOT included as part of the primary key, the display in Visual Studio notwithstanding.
So, apparently it's just a clumsy, confusing way of displaying the fields of the tables in Visual Studio Server Explorer.
Yeesh. I miss Management Studio already ...

Resources