Categories
Database Development

Cannot find the object because it does not exist or you do not have permissions when updating database

Migration is successful, yet when trying to update the database, I get that error. I had a similar issue before, because I did not create a proper DbSet<> for the table. This time, it’s not the case. My DBContext: using System; using System.Collections.Generic; using System.Text; using ArtGalleries.Domain; using Microsoft.EntityFrameworkCore; namespace ArtGalleries.Data { public class ArtGalleriesContext:DbContext […]

Categories
Database Development SQL

How restore your SQL Server database with smo without exception in smo

Why am I getting an exception when restoring a SQL Server database using SMO in WPF? This is my code: ServerConnection conRestore = new ServerConnection(LaServerInstance); Server ServerRestore = new Server(conRestore); Restore RestoreObject = new Restore(); RestoreObject.Action = RestoreActionType.Database; RestoreObject.Database = “Mainwaterphantom”; BackupDeviceItem source = new BackupDeviceItem(open.FileName, DeviceType.File); RestoreObject.Devices.Add(source); RestoreObject.ReplaceDatabase = true; RestoreObject.SqlRestore(ServerRestore); MessageBox.Show(“Successful Restore”); and […]

Categories
Database Development

When I edit my html table to update, my inputs are not detected and only the word Array and number 1 is displayed and updated to my database

So I’m working on this table on which the user can edit and remove a row if he wants to. I used input type=”text” in the cells so it can be edited but when ever I edit the cells all i get is the word array and the number 1. Remove button is working fine […]

Categories
Database Development

Creating a database query Spring boot JPA?

I’m new to spring boot.I need to create a method findByCode which is somewhat similar to findById() but take Long code instead of Long id.(Code is not the primary key).Can someone plz help database timetablemappings(id,start,end,day,code) TimeTableMapping View @Entity @Table(name=”timetablemappings”) @EntityListeners(AuditingEntityListener.class) public class TimeTableMapping { @Id @GeneratedValue(strategy = GenerationType.AUTO) private Long id; private String day; private […]

Categories
Database Development Vue

How to set marker with coordinates from a database using Vue.js

I have some vue class that shows a map and I want to put a marker with coordinates from a database that I get using an API. I have already stored the value on a variable, but the marker wont show. <template> <div class=”App” /> </template> <script> import gmapsInit from “../../../gmaps.js”; export default { name: […]

Categories
Database Development SQL

Can’t access SQLITE database Android

I’ve created a SQLite database when I call this method : public boolean checkDataBase() { SQLiteDatabase checkDB = null; checkDB = SQLiteDatabase.openOrCreateDatabase(DATABASE_NAME, null); checkDB.close(); return checkDB != null; } I get this error: android.database.sqlite.SQLiteCantOpenDatabaseException: unknown error (code 14 SQLITE_CANTOPEN): Could not open database The DB is created, I could retrieve it from the emulator file […]

Categories
Database Development

How to create a user who has ReadOnly access in the Database but has ALL privileges on the schema in the Database?

I am trying to create a user who can select all tables within a DB in AzureSQL. but has privileges to Insert,delete, update on his own schema(ODS) within the DB?

Categories
Database Development Drivers SQL

java.sql.SQLException: No suitable driver found for jdbc:sqlserver when connecting to azure database

im using an azure database and I added all necessary JAR files to my library. Here is my code, im not sure why it is unable to connect. Please advise. String connectionUrl = “jdbc:sqlserver://bcs430-final-project.database.windows.net:1433;” + “database=OASIS ASSISTANT;” + “user=farmingdale@bcs430-final-project;” + “password=bcs430w!;” + “encrypt=true;” + “trustServerCertificate=false;” + “loginTimeout=30;”; String insertSql = “select * from dbo.BCS102 where […]

Categories
Database Development SQL

Clone azure SQL elastic database to non-elastic server in a different resource group

I’m trying to clone an existing Azure SQL DB that’s in an elastic pool to a standard SQL server in a different resource group. Whenever I run (with Az Powershell) Restore-AzSqlDatabase -FromPointInTimeBackup -PointInTime (Get-Date) -ResourceGroupName $TargetRGName -ServerName $TargetServerName -TargetDatabaseName $TargetDBName -ResourceId $Database.ResourceID, I get the error Long running operation failed with status ‘Failed’. Additional Info:’An […]

Categories
ASP.NET Database Development

How to save Images to different folders in database using ASP.NET Core?

I have an ASP.NET MVC project that is working fine to save images to different folders and sub folders. But when I want to do similarly in ASP.NET Core 2.2, it is not working as it is and I need help to solve this problem and I would appreciate your help very much. Here is […]