.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Refresh dbml when database schema changes

Posted By:      Posted Date: October 05, 2010    Points: 0   Category :ASP.Net


 I have a .dbml file that I have dragged several tables on to from a database in the Server Explorer.  I have written a lot of code against the model that was created.

Now I have added another table (Companies) to the database and a Foreign Key in one of my existing tables (People) which references the PK of the new table.  I have refreshed the Server Explorer and can see the new table and the new FK in my existing table.  I can drag the new table on to the dbml workspace, no problem.  But how do I make the new FK appear in the dbml class?  I have tried right-clicking on the .dbml file in the Solution Explorer and choosing "Run Custom Tool" but that doesn't do anything.  I suppose I could just delete the .dbml file and start all over again, but surely there is a better way!  Eventually there will be dozens of tables involved and recreating every time one column changes in one table would be very painful.

Please tell me that I am overlooking something simple.

As a matter of interest, what if I went the other way and added or modifed a class in the dbml, can I get the database schema updated?

thanks in advance


View Complete Post

More Related Resource Links

Refresh dbml when Stores Procedurs are Changed in database



I have a DBML file in C#. And I have drag and drop some Stored Procedurs in it . Now I have changed some SPs. Now I want to refresh the dbml file without drap and drop the SPs. How can I do it in C#. Is there any way that the changes Made in SPs will come with out drag ang drop the SPs.

How to extract a schema from a sql server database



  I need to extract or get the schema from tables in my databse and what is the best way to do it. Is there any third party tool to do it??


Any idea will be appreciated..



Metadata: Create a Database Schema Repository with Meta Data Services in SQL Server 2000


SQL Server 2000 Meta Data Services is a repository technology that stores and manages metadata for SQL Server. Instead of building database schemas over and over, Meta Data Services allows you to freeze an entire schema for use in other projects. You can also use these schemas for training, testing, or debugging. In this article, the authors will review the various components of Meta Data Services and show how it can be programmed using a Visual Basic client, XML, and XSLT. They will also show you how to manage and manipulate your metadata by generating a simple database schema using a SQL Server repository.

Alok Mehta and Ricardo Rodriguez

MSDN Magazine May 2003

SQL/MTS: Automating the Creation of COM+ Components for a Database Schema


Using Microsoft Windows DNA architecture as a guideline, it's possible to create scalable multitier database applications with COM+ and Microsoft Transaction Services. In fact, you can use existing table definitions to automatically build the MTS/COM+ business logic layer and data access components for your application. This article will walk you through the development of database transactions by mapping the transactions to automatically generated MTS/COM+ components. This technique can greatly simplify the task of creating components for a large project.

Aleksandr Mikunov

MSDN Magazine July 2000

Insert permission was denied on Object '', database '', schema ''

i have a senario where in i am trying to insert data into a Database , i end up getting the above error 'Insert permission was denied on Object '', database '', schema '''.We have a DB which has all Storeprocedures and 90% of the tables . the remaining 10% of the tables are in a different database.I am having trouble inserting data into the second database.The storeprocedure is executed as a user who has permission on the DB and tables.Also the storeprocedure is given permission to a role in which the user is a member . The same role doesnt exists in the 2nd Database.I am able to do all DB operations in one environment . i am unable to do the same in the others.

The SELECT permission was denied on the object 'sysjobs_view', database 'msdb', schema 'dbo'.

So, I have an SSIS package that uses a transfer jobs task between Server A and Server B.  When I run the package with my credentials, everything works fine.  However, when I run the package from an SSIS using a different user, I get the following error: Date 9/1/2010 8:00:00 AM Log Job History (xxx) Step ID 1 Server xxx Job Name xxx Step Name Run SSIS Duration 00:00:01 Sql Severity 0 Sql Message ID 0 Operator Emailed Operator Net sent Operator Paged Retries Attempted 0 Message Microsoft (R) SQL Server Execute Package Utility Version 10.0.2531.0 for 64-bit Copyright (C) Microsoft Corp 1984-2005. All rights reserved. Started: 8:00:00 AM Error: 2010-09-01 08:00:01.39 Code: 0xC002F325 Source: Transfer Jobs Task Transfer Jobs Task Description: Execution failed with the following error: "An exception occurred while executing a Transact-SQL statement or batch.". End Error Error: 2010-09-01 08:00:01.39 Code: 0xC002F325 Source: Transfer Jobs Task Transfer Jobs Task Description: Execution failed with the following error: "The SELECT permission was denied on the object 'sysjobs_view', database 'msdb', schema 'dbo'.". End Error DTExec: The package execution returned DTSER_FAILURE (1). Started: 8:00:00 AM Finished: 8:00:01 AM Elapsed: 0.75 seconds The strange thing is, the user running the job ahs sysadmin permissions

Update Database Schema without redeployment in Entity Framework

Hello. we build an app with 2 layers i.e the presentation and the Business layer which holds the business logic and have the entity framework provide us wtih entities. my question here is is there a way we can change the database schema and not have to redeploy the app to the client.  

database refresh time

Hi,we have a sql server 2005...that has 70-80 databases and hundreds of tables....It is supposed to refresh every night.... refresh is done by other vendor(3rd party).... we dont know what method(technology) they use to refresh the databases....My question is .....Is there a good way to know when the last refresh has happend...can we determine it from sys tables.....the sql server is installed in window server 2003 box.... we have access to the box as well as the sql server.....plz suggest...

WSS_Logging database schema

Are there any sources of information on what the individual columns and tables of the WSS_Logging database mean?  Or is this purely a trial and error process?

"Database schema could not be retrieved for this connection" Error using VWD 2010

After downloading VWD 2010 Express. I drag the SQL Data Source, When trying to establish any type of connection get the error below. I CAN connect using the OLE  (.NetFrame data provider for OLE DB work) but CAN NOT connect using (.NetFrame data provider for SQL server) I have VWD 2008 in another PC and work just fine. I did google and tried several solutions that other had with no luck. I know they were not using VWD 2010 but it was the same error. Again no luck with those solutions. If anyone can share it would be greatly apreciated! Thanks in advance!Jimmy "Database schema could not be retrieved for this connection. Please make sure the connection settings are correct and that the database is online. This server version is not supported. You must have Microsoft SQL Server 2005 or later."    

database schema for online account opening form

what should be the database schema for online account opening form with joint account holders and every participants (in a joint account) have seperate contact and personal detials.Please suggest.

Refresh update panel when database changes

I have an admin page in which I need to change the list whenever a user signs up on our web site.How can I put and event to MySql database so that whenever the count of  a table row changes it refreshes my update panel for me to see the new user.

Managing TypedDataSets when there is a change in backend Table / Stored Procedure / Database schema

Hi All, I am just curious to know if there is any easier way to synchronize the TypedDataSets with the chages made to backend Table / Stored Procedure schema.  I use Typed DataSets in my project extensively and I found them very useful and easier to code, but difficult to maintain  The difficuly I have always faced is whenever there is a change in a backend database table structure or stored procedure that is linked to any of the Typed DataSet in our project requires to recreate whole DataSet again by scrapping the old one. The backend changes will not be reflected unless and untill you recreate the whole stuff again. Is there any easier way to synchronize those typed datasets with the changes made to backend database schema or any other workaround that will not required to recreate the whole DataSet again.Hope above question makes sense. Any ideas.

Difference between Last Processed and Last Schema updated in OLAP Database .

I have a OLAP database in my server.Today I processed the OLAP database using "Analysis Services Process task" using SSIS.After this, I  checked the properties of the OLAP database (AS-->Databases-->Corresponding Database->Right click --> Properties -->), in that , I can see the time is updated in the
1.Last Schema update   and
2.Last update.
    I dont find find any change in the "Last Processed" Time.?
Now I want to know the difference between 1.Last Schema update   2.Last update. and  3.Last Processed.
Your help would be greatly appreciated.

database schema prefex


i am using sql server 2008 , i got different tables & store proc having different prefex, How can i change them all to dbo?

Can it be done through sql management studio?

The SELECT permission was denied on the object 'aspnet_Membership', database 'Employee', schema


I am having IIS server and SQL server on two different machines. 

In the SQL server I created a new user using the SQL Authentication.

In my application I am using a connection string like this:

<add name="UsrConnectionString"
      connectionString="Data Source=\GEOGSQL;Initial Catalog=ITAM; 
      User Id=itam; 
Password=itam_web;" providerName="System.Data.SqlClient" />

<add name="UsrConnectionString" connectionString="Data Source=x.y.z.w\instancename;Initial Catalog=Employee;  User Id=xyz;  Password=xyz;" providerName="System.Data.SqlClient" />

I can access the other tables within the Employee database. But I am unable to access the tables created by ASP.NET autom

The EXECUTE permission was denied on the object 'sp_start_job', database 'msdb', schema 'dbo'.


I am getting the following error when I execute an SSRS report.

The EXECUTE permission was denied on the object 'sp_start_job', database 'msdb', schema 'dbo'.

The report is executing a stored proc. Which in turn is running an Agent Job.

When I run this report through BIDS it works fine. It is only when I run it though Report Manager I get a problem.

Can anybody help?

Mr Shaw
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend