SET SQL_SAFE_UPDATES = 0;
Sunday, December 27, 2020
Monday, December 14, 2020
how to find the table name using column name in mysql
SELECT DISTINCT TABLE_NAME
FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME IN ('columnA','ColumnB') AND TABLE_SCHEMA='YourDatabase';
Wednesday, December 2, 2020
linq error At least one object must implement IComparable
Well, you're trying to use SortedSet<>
... which means you care about the ordering. But by the sounds of it your Player
type doesn't implement IComparable<Player>
. So what sort order would you expect to see?
Basically, you need to tell your Player
code how to compare one player with another. Alternatively, you could implement IComparer<Player>
somewhere else, and pass that comparison into the constructor of SortedSet<>
to indicate what order you want the players in. For example, you could have:
public class PlayerNameComparer : IComparer<Player>
{
public int Compare(Player x, Player y)
{
// TODO: Handle x or y being null, or them not having names
return x.Name.CompareTo(y.Name);
}
}
Then:
// Note name change to follow conventions, and also to remove the
// implication that it's a list when it's actually a set...
SortedSet<Player> players = new SortedSet<Player>(new PlayerNameComparer());
linq orderby collection property
IQueryable<Parent> data = context.Parents.OrderBy(p=>p.Children.OrderBy(chi => chi.Name).FirstOrDefault());
Tuesday, December 1, 2020
How to execute sql queries in workbench mysql ?
If you are from MS SQL background and first time working with MySql , you may be struggling for finding the shortcut key to execute the sql query in workbench.
Here is the short cut to execute the SQL query in workbench MySql.
- Execute (All or Selection) -> Ctrl + Shift + Enter.
- Execute Current Statement -> Ctrl + Enter.
ASP.NET Core
Certainly! Here are 10 advanced .NET Core interview questions covering various topics: 1. **ASP.NET Core Middleware Pipeline**: Explain the...
-
The error message you encountered ("DeleteService FAILED 1072: The specified service has been marked for deletion") indicates tha...
-
replace html of a div using jquery this is simple . just use .html() method of jquery to set new html for a div . $ ( "#divID...
-
declare @ProductIds nvarchar(50)='18,19' SELECT * FROM products Where (',' + @ProductIds +',' LIKE '%,' ...