Bailey
Can anyone help me switch my primary key column from int to uniqueidentifier for my web app?
Hello,
before anyone can give a good answer, there is a lot of info needed. Just some pointers:
- Is it a database which already is filled with records?
- If there are any records, can they be removed
- Is it an empty project ==> if Yes, you can delete the project and recreate with the correct id's.
The sollution is dependant on the situation.
If it's a relational database which is filled with data, there is (not necessarily) another sollution then if it's a new project.
Just an example (of a possible sollution) if you got an existing relational database:
1) create the guid collumns (nillable)
2) fill the records with the related guids
3) add the foreign key
4) do checks by queries
5) remove the old foreign key and tables.
7 replies
nugget package update
Hi,
I think there are 2 issues namely:
- somehow the program you got creates an error. and this can be a result of a nuget package.
- It tries to start the debugger, but has no permissions.
To solve it, you could give the debugger permissions and try to find the cause or check the nuget packages and check the dependancies (and downgrade when necesary).
13 replies
✅ Different output on same code.
catch (Exception ex) // this catches the exception and adds the exception is in the var ex.
{
var exception = new UDDivideByZeroException(number1, number2); // this just creates a local variable with a self defined exception
return 0; // returns a 0
}
}
109 replies
Null Literal and NUll reference problems
Hi,
I'm looking at the code and there can be a number of causes. Hope you can use the following:
I would replace the array with a list like:
List<Employees> listEmployees = new List<Employees>();
and add items using:
listEmployees.Add(new Employees(line, Convert.ToInt32(line[1]), Convert.ToDecimal(line[2]), Convert.ToDouble(line[3])));
the second part is about ul reference. What you do in the code:
employees[LineCount] = new Employees(line, Convert.ToInt32(line[1]), Convert.ToDecimal(line[2]), Convert.ToDouble(line[3]));
- convert the second char into integer
- convert the third character into decimal
- convert the fourth char into double.
When the line does not have the chars, the array (a string is under the hood an array of chars) it will give a null reference error.
There are more possible tests you can add but first start something like below within the loop.
if (string.IsNullOrEmpty(line) || line.Length <5 )
{
// give some error or message and put breakpoint to look at data
}
18 replies
udemy course advice related to C# , .net
Hi,
I've done this course and it is a good beginners course but it is a course based on backend with some frontend. If you want more you should also follow a independant frontend course.
Bootstrap is used with angular.
another thing, just my advice. think of a project which fits in the course and try to make that instead of typing over, this helps understanding, but also helps to see what and where you need more.
26 replies
✅ Guidance in software development
Hi,
You're question is not as simple as saying learn c#.
Knowing the syntax of a language is part of being a developer. The other part is knowing how to structure a application / buildin it safely.
you could seach for courses on youtube "IAmTimCorey". these are quite nice
26 replies
Controls from WPF.UI can't render properly on WPF, .NET Framework 4.8
Hi,
an issue like this is very difficult to analyse when you dont have the complete code.
That said, maybe you can use the following:
99% o the time when having issues like this (and it does not matter which language / framework etc) it the cause of:
- Not able to map the font
- Resources missing (not added to the sollution).
- Typo with the resource.
So it could be as simple as that the resource must be included (or set on copy always in the sollution).
Hope this helps
20 replies
reflection good course
Keep in mind that this is reflection.
So themethod e.g.
public void Sort(object toSort) { // Here I can use Get properties as an array and get the list property. // After this I want to convert the property to a list or any Collection listproperty = (Ilist) theListProperty ==> this works listProperty = (List<>) theListProperty ==> this gives a runtime error. } Having this said. I already found away around this. So I'm searching for good documentation / course on reflection. But it seems not to be available.
public void Sort(object toSort) { // Here I can use Get properties as an array and get the list property. // After this I want to convert the property to a list or any Collection listproperty = (Ilist) theListProperty ==> this works listProperty = (List<>) theListProperty ==> this gives a runtime error. } Having this said. I already found away around this. So I'm searching for good documentation / course on reflection. But it seems not to be available.
20 replies