15,921,643 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Jordan Nash (Top 17 by date)
Jordan Nash
20-Feb-22 2:06am
View
Hi I have swapped the images as they were in the wrong href tags.
Jordan Nash
22-Aug-21 3:33am
View
So I read this https://docs.microsoft.com/en-us/visualstudio/debugger/debugger-feature-tour?view=vs-2019#set-a-watch
Then set watches on JobID and ID in the controller.
The strange thing is if I get out of the page and go back to it I notice when I debug that the ``JobID`` is being passed to it fine but then I unassign the user (delete the registration) and assign them again. That's when 0 is assigned to JobID. If any mentor is willing to Teamview or something with me please PM me and I can workout some sort of payment for your time. Else please advise me how I should debug further, thanks.
Jordan Nash
20-Aug-21 4:34am
View
So I have used breakpoints and found the JobID returned as 0. Other than that I cannot find why I'm getting this error. I have displayed the migration in my question today where I'm getting the error from FK_tblRegistration_tblJob_JobID
Jordan Nash
17-Aug-21 2:31am
View
This problem gets even stranger. So when I use that code you made to check for null in the action, the error will be gone now regardless of which record it is. so I swapped my original line for yours. But if I assign a user now, I will get this error.
```
An unhandled exception occurred while processing the request.
SqlException: The INSERT statement conflicted with the FOREIGN KEY constraint "FK_tblRegistration_tblJob_JobID". The conflict occurred in database "Pitcher8", table "dbo.tblJob", column 'ID'.
The statement has been terminated.
```
Jordan Nash
12-Aug-21 7:21am
View
Already did all that as explained. I cannot see anything out of the ordinary other than what I said. Here is a gif I'm sharing if you can see what I'm doing wrong, please. https://s6.gifyu.com/images/Animation1cff8e6cf7f6fdd3d.gif
Jordan Nash
12-Aug-21 6:57am
View
Yes I knew that. I forgot to delete that with _context.Jobs not doing anything. The reason why I put it in was I was studying the error https://docs.microsoft.com/en-us/dotnet/api/system.nullreferenceexception?view=net-5.0 and found out I wasn't instantiating Jobs. I'm not convinced instantiating it will help as the error only occurs with some records. If I delete var id=@model.ID in one place it will not change the output except it will report the error in the other table containing the variable. But if I delete the variable from both tables then it will stop the data appearing in the tables.
Jordan Nash
9-Jun-21 7:25am
View
My problem is I can't attach the DB. None of the databases are appearing in my new connection profile which I assume means they are detached like you say. I will do this in VS Code.
So, if I run the first code snippet in the link you gave me.
use master
go
select db_name(database_id) as [Database Name],type_desc as [File Type], physical_name as [Database File Location] from sys.master_files
where database_id>=5 --exclude system databases
The localhost connection profile won't detect any database or log files with them in the desired directory path from where they were originally generated by EF Core.
This is the path. "C:\Users\Jordan". All the .mdf and .ldf files of different DBs are right there in my file explorer.
I tried to attach the file using this snippet from the link you provided to attach it.
USE [master]
GO
create database [Pitcher8] ON
(FileName='C:\Users\Jordan\Pitcher8.mdf'),
(FileName='C:\Users\Jordan\Pitcher8_log.ldf')
FOR ATTACH;
It results in this error.
Msg 5173, Level 16, State 2, Line 3
One or more files do not match the primary file of the database. If you are attempting to attach a database, retry the operation with the correct files. If this is an existing database, the file may be corrupted and should be restored from a backup.
Msg 1802, Level 16, State 7, Line 3
CREATE DATABASE failed. Some file names listed could not be created. Check related errors.
So I check error Msg 5173 and go here https://www.sqlserverlogexplorer.com/fix-sql-server-error-5173/
Then I do this.
CREATE DATABASE [Database] On PRIMARY
(NAME = N'Pitcher8',FILENAME = N'C:\Users\Jordan\Pitcher8.mdf')
LOG ON
(NAME = N'Pitcher8_log', FILENAME = N'C:\Users\Jordan\Pitcher8_log.ldf')
GO
Then I get this error.
Msg 5123, Level 16, State 10, Line 1
CREATE FILE encountered operating system error 5(Access is denied.) while attempting to open or create the physical file 'C:\Users\Jordan\Pitcher8.mdf'.
Msg 1802, Level 16, State 4, Line 1
CREATE DATABASE failed. Some file names listed could not be created. Check related errors.
File system permission errors? I don't know. Either way I went here.
https://www.sqlserverlogexplorer.com/fix-sql-server-error-5173/
Did this.
CREATE DATABASE [Database] On PRIMARY
(NAME = N'Pitcher8',FILENAME = N'C:\Users\Jordan\Pitcher8.mdf')
LOG ON
(NAME = N'Pitcher8_log', FILENAME = N'C:\Users\Jordan\Pitcher8_log.ldf')
GO
Which returned this error.
Msg 5123, Level 16, State 10, Line 1
CREATE FILE encountered operating system error 5(Access is denied.) while attempting to open or create the physical file 'C:\Users\Jordan\Pitcher8.mdf'.
Msg 1802, Level 16, State 4, Line 1
CREATE DATABASE failed. Some file names listed could not be created. Check related errors.
I try to attach it in SMS explorer. I can't even see any of the databases listed in C:\Users\Jordan of the Locate Database Files dialogue box. So I copy the files I want to C:\Data and open Pitcher8.mdf. Then I get this error.
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
Unable to open the physical file "C:\Data\Pitcher8.mdf.mdf". Operating system error 2: "2(The system cannot find the file specified.)".
CREATE DATABASE failed. Some file names listed could not be created. Check related errors. (Microsoft SQL Server, Error: 5120)
What am I missing please?
Jordan Nash
15-Apr-21 6:51am
View
My intention was to return the RegistrationID here which will be deleted though obviously that's not what I'm doing here because I don't know how to. Essentially the reason why you are confused is because I was confused.
I was trying to base my deletion method on the AssignUserRegistration method using the two parameters and do the reverse of that and also base it on the Delete actions generated by EF Core by default. Yes the null check is pointless and the compiler warned me. You could say I didn't know what to check for. At this point I am staring at the problem. I realize now I don't have to check for the UserID or JobId as EF Core will do a cascade delete so really I just have to work on the RegistrationID and workout how to delete it.
Jordan Nash
21-Mar-21 15:45pm
View
Shortened the question, by taking out irrelevant methods and class. I left the models as is as I am not sure they are irrelevant.
Jordan Nash
6-Feb-21 19:58pm
View
Thanks for your help Richard. While your answer solves the initial problem I listed in the title, it doesn't display a table list of unassigned users that don't contain matching ID of the newly created record. I'm wondering if you would know how to do that please? I'm stuck right now.
To elaborate, In the method JobsController.GetUnassignedUsersJobId(int? ID) I have ascertained that we are getting the last JobID but we are not comparing it to all the records in the userlist.
Jordan Nash
29-Jun-20 0:35am
View
Thank you. Your code has actually solved my problem and all the listed problems appear now.
Jordan Nash
5-May-19 6:29am
View
Because I want to map all the values in the "Data" column to rename a bunch of filenames in a drag drop box form. The values would would be written to all of the files. I wanted to have the user create csv files at the touch of a button and read their contents to the gridview and print it to the filename. The Description header is just a meta data column should they be creating several files and forget what all the data is for.
Is there something wrong with my approach there and if so how can I optimise it?
Jordan Nash
28-Jun-18 4:09am
View
Hello,
Unfortunately I am having trouble compiling your code. Could you please show it in full with the loops and if statements if appropriate to this situation. Lastly, sorry but your use of the AddRange method doesn't appear to be working as it doesn't accept a string list.
Jordan Nash
16-Jun-18 6:27am
View
I have already done this 3 days ago. No one responded. Perhaps I need to have more patience. I will put my previous comment from here to that question I already posted on that forum.
Jordan Nash
16-Jun-18 6:26am
View
Deleted
I have already done this 3 days ago. No one responded. Perhaps I need to have more patience. I will put my previous comment from here to that question I already posted on that forum.
Jordan Nash
16-Jun-18 6:03am
View
I changed the loadImageMetaData() method to this. The setTag() method was expecting a Bitmap of course so I instantiated one.
private void loadImageMetaData()
{
lstImageMetaData.Items.Clear();
Bitmap bmp = new Bitmap(_big_fileName);
EXIF.EXIFextractor er2 = new EXIF.EXIFextractor(ref bmp, "\n");
foreach (Pair s in er2)
{
lstImageMetaData.Items.Add(s.First + " : " + s.Second);
}
lstImageMetaData.SelectedIndex = lstImageMetaData.Items.Count - 1;
er2.setTag(0x5013,"Thumbnail Width");
}
So, I’m not getting the error anymore but it still won’t display the “Thumbnail Width” metadata. Do you know what I’m doing wrong, please?
Jordan Nash
14-Jun-18 5:04am
View
Ah, yes I realize I had a method overload of the exact method where the error was. It's here in EXIFextractor.
public void setTag(int id, int len, short type, byte [] data)
{
PropertyItem p = CreatePropertyItem(type,id,len,data);
this.bmp.SetPropertyItem( p );//Error on this line.
buildDB(this.bmp.PropertyItems);
}
Show More