Dynamic Data website only displays rows that it inserted to DB - sql-server

I'm pretty new to creating dynamic data websites - I created one a year ago that is working fine but now I'm trying a 2nd one and having a strange problem.
I'm using VS2010, VB.net & followed MS's waltkthrough for creating a web site using Linq to SQL. Things seem to be working with one MAJOR exception. I've pointed it to a SQL server in my domain but it won't display rows from the DB that were not created through the website. Records that I manually enter through SSMS do not show in the DD List for the table, but rows I inserted thru the website do appear.
I have cleared the table and refreshed the list view and all rows disappear. Then if I add rows via SSMS they do NOT show up but website added ones do. This is important because I'm going to be importing data from an old (non SQL) DB that I'm converting.
I really don't know where to look to resolve this - Does anyone have any ideas?
Thanks!

The records I entered thru ssms had bad values for a foreign key and evidently DD is doing inner joins instead of left outer. I don't know if that is a bug or a feature.

Related

To change the IDENTITY property of a column error in EF Core DB

I started getting this message when trying to add a new column to a database table. I did not try to make any change to the key column in the DB.
To change the IDENTITY property of a column, the column needs to be dropped and recreated.
So working through various potential solutions online, I have been trying to drop the table and replace it etc. without any luck. When I run Update-Database in PMC I get the same error so nothing can be dropped, nothing can be added to the DB. Its completely blocked and I have no idea why because I did not change anything fundamental in the DB, I just added a normal int column to the table and tried to migrate an update.
So then, I saw info online saying that I should delete the table and update the database, and EF core would replace the table to get the DB back in sync. I right-clicked the table in VS SQL Server Object Explorer and deleted it. But when I add the migration and run Update-Database, I again get the error:
To change the IDENTITY property of a column, the column needs to be dropped and recreated.
This is not yet in production, so I don't care about the data loss from deleting my table, but its completely blocking me. How can I get my Database-Update to run again so I can get my table back and not see this error?
I have no idea what caused this issue. At this point I'm thinking I should create a brand new database in Azure for my solution and recreate tables one by one, but that will take days/weeks and I don't know if it will get rid of this issue.
Has anyone come across this issue and do you know if recreating my DB from scratch will solve the problem or does it usually originate somewhere that a complete DB recreation wont help?
I fixed it! Sometimes you just need to write it down to come back with a fresh approach!
By using ''Update-Database -Migration [migration name]'', I was able to try every migration one by one, working back from the most recent. By doing this I identified that the problem was with a specific migration 4 or 5 migrations back. Thankfully I always keep migrations small. I then used Remove-Migration to remove them one by one, back to the last good one. This allowed me to follow the steps I found online and was trying yesterday, to create a new table. But I had another error about duplicate column names, so I needed to create my new table with no columns, and delete some columns from the model of the old table before I could drop the offending table (Still dont know why it stopped working). Then I added the old table model to the new one to get my columns back and renamed the new table to match the old one. Working fine now. There was also a bit of commenting and uncommenting needed to get the build working as I switched the tables.

Cannot edit one record on linked table write conflict

We have a linked table in our Access 2010 database, the backend is SQL Server 2012, via an ODBC connection. The table is indexed (unique, non clustered) on a single field, the record's identifier.
The issue is that the odd record throws a 'write conflict - record changed by another user' type error when it is edited through the Access front end, but can be edited directly in SQL. Other records are fine. It's not the same record each day. The whole situation is a complete mystery to me so here are all the fact, maybe someone can make a coherent picture out of this.
The error message takes two different forms, depending how the edit is attempted. The normal functioning of the front end does it by opening a DAO recordset with just the one record, doing a bunch of edits on different fields, then closing the recordset and setting all object variables back to nothing. That produces first the "Write Conflict - This record has been changed by another user since you started editing it." error, with "Drop changes" or "Copy To Clipboard" as the options." It is then followed up with error 3197 "The Microsoft Access database engine stopped the process because you and another user attempted to change the same data at the same time."
If I just open the table in Access and manually try to change the record, I get the write conflict version of the error only. (Needless to say, I have confirmed that no other users are in the table at all, let alone the record.)
I can edit the row in SQL, and I can edit the row using a query in Access (via query design).
The data in the table is built each morning, and each day it seems to be a different record or two that is affected. It has only gone on for a few weeks, in a setup that has been running fine for about 6 months with no changes that could account for this (at least, that I can think of). The data build truncates the table and inserts all the records from scratch, and then rebuilds the index.
Here are some things I've tried:
Decompiling the database, compact and repair, relinking the table.
Linking the table into a brand new database that only has that one table in it.
Rebuilding the index.
Deleting the row and re-inserting it
Rebooting the SQL server (that was due to something else, but the problem still continued afterward.)
Opening the front end on a different computer.
Any help would be much appreciated!

Is there a way to update an oracle database by simply editing a table in excel?

I have gotten oracle database to connect to an excel spreadsheet except for 1 issue -- the excel table is not properly refreshing (i.e. a row I deleted in oracle still shows up in excel version). How is this happening? I cannot figure out how to get it to reflect the current version of the database without making a new spreadsheet and reconnecting. Even if I clear the table, My refresh data button brings back those rows that don't exist anymore
Also, I want to make a user-friendly way to add or delete rows in oracle via excel spreadsheet. So whatever I do in excel would automatically update in the oracle database. Is this even possible or am I really overreaching?
Does anyone have any ideas or tips? I'm not very technical so please dumb down any responses

EntityFramework wants to delete a table from my data model that is very clearly in the database. Any ideas why?

I am attempting to update my EntityFramework data model from a SQL 2008 database to add a couple new tables. There are at least 100 other tables in the model and they are all fine and slated to be refreshed, but EF keeps insisting that this one table does not exist in the database, even though I am looking right at it and can select from it, and adds it to the "Delete" list. The connection string is correct and the columns inside the table match what is currently there. Any idea why this might be happening and how I can fix it?

Visual Studio DataSet Designer Refresh Tables

In visual studio datasource designer is there any way to refresh a table and its relations/foreign key constraints while keeping the custom queries?
The way I am doing it at the moment is removing the table and adding it again. This adds all the relations and refreshes all fields.
Also if I change a fields data type, is there a way to automatically refresh all the fields in the datasource? Again without deleting the table and adding it again.
Reason for this is because some of my TableAdapters have quite a number of complex queries attached to them and when I remove the table the adapter gets removed as well including all its queries.
I am using Visual Studio 2008 and connecting to a MySQL database.
Any1 have an idea?
Each table has a default query (The one on top with the check on it). When you dragged your tables in to the dataset to create the query, it wrote a SQL statement which it uses to schema your table. Keep that query simple, you might not actually use it in code, and you can always edit that query to update the table schema.
Every time you open the default query it connects to your datasource and allows you to select new columns that weren't in there before. If you want to update your existing columns, delete all the columns out of the table before you attempt to open the query. When you save the query, your updated columns get added back.
Make sure your connection string has permissions to view column information.
I reported this to MSFT but no response. The designer hangs all the time on the simplest of SQL statements. What I found that works for me is.
Add a new table to the designer.
Save it.
Shut down visual studio 2010.
Start VS 2010.
Add one or two more SQL statements and follow steps 2-4 again.
This is a pain in the neck but the only thing that stops Visual Studio dataset designer from hanging. I experienced in this same issue in VS 2008. I am connecting to Oracle but still shutting down VS and starting it back up works, but really, this is nonsense.
You can add/change/remove fields and relation ships, but i would suggest looking into NHibernate.
You should be able to right-click the dataset in solution explorer and select "Run Custom Tool" to refresh the table and it's query/relationships.
If that command is not there, check that the dataset properties has "MSDataSetGenerator" in the Custom Tool field.
Right click on your DataSet name and select Dataset Properties
Below the Query box you will see a button for Refresh Fields.
Click on Query Designer and the new field should show in your table list.

Resources