-
MY PROJECTS
-
Recent Posts
- SQL.How can you compare two nullable values safely, and how does IS DISTINCT FROM differ from <>?
- SQL.How are NULL values ordered by ORDER BY, how do defaults differ between databases, and how can you control their placement?
- SQL.How does NULL propagate through arithmetic expressions, and how can COALESCE and NULLIF help handle missing values and division by zero?
- SQL.How does NULL affect join conditions, and why can filtering the right-hand table in WHERE remove unmatched rows from a LEFT JOIN?
- SQL.How do GROUP BY and DISTINCT treat NULL values, even though NULL = NULL evaluates to UNKNOWN?
- SQL.How do aggregate functions handle NULL, and what is the difference between COUNT(*), COUNT(column), and COUNT(DISTINCT column)?
- SQL.How does NULL affect IN and NOT IN, and why can NOT EXISTS be a safer choice when a subquery returns nullable values?
- SQL.How do WHERE, HAVING, and CHECK constraints treat conditions that evaluate to UNKNOWN?
- SQL.Why do column = NULL and column <> NULL not work as expected, and when should you use IS NULL and IS NOT NULL?
- SQL.What is SQL’s three-valued logic (TRUE, FALSE, UNKNOWN), and how do AND, OR, and NOT behave with UNKNOWN?
- ChromeDevTools.Watch all failed requests
- SQL.What are domain types (or constraints on data types), and how do they help enforce data correctness?
- SQL.How does SQL handle comparisons between different data types (for example, string vs number), and why is this dangerous?
- SQL.What is the difference between DATE, TIME, TIMESTAMP, and TIMESTAMPTZ, and which one should be used for business events?
- SQL.How do numeric types like INTEGER, BIGINT, DECIMAL, and FLOAT differ in terms of precision and use cases?
- SQL.What problems can arise from implicit type casting in SQL, and how can it affect indexes?
- SQL.How does NULL differ from 0, an empty string, or FALSE in SQL?
- SQL.What is the difference between CHAR, VARCHAR, and TEXT, and when would you choose each?
- SQL.What is MVCC ?
- SQL.What is AutoVacuum Postgres ?
Categories
- Aptana
- Azure
- C#
- DataSnap
- DBExpress
- Delphi
- Delphi и сети
- Delphi. Язык программирования
- ExtJS
- FastReport
- FireDAC
- FireMonkey
- GIT
- ICS
- IDE
- IIS
- Indy
- InnoSetup
- javascript
- jQuery
- JSON
- LiveBindings
- MSHTML
- MySQL
- PHP
- REST
- Ribbons
- SMS
- SQL инструкции
- SVN
- TRichView
- UniGui
- WebBroker
- WinAPI
- Windows
- Алгоритмы
- Без рубрики
- Деревья
- Ищу ответ
- Компонентостроение
- Мои компоненты
- Начальный уровень
- Обработка исключений
- Парсинг
- Потоки(Threads)
- Регулярные выражения
- Тестирование приложений
Category Archives: C#
C#.Mvc.Js.Events
3 способа подключения событий В теге элемента Прямое присваивание Через AddEventListener (можно несколько обработчиков сразу присвоить) Events.js
|
1 2 3 4 |
function OnClick() { alert('here'); } document.getElementById('2').onclick = OnClick; document.getElementById('3').addEventListener('click', OnClick); |
Представление
|
1 2 3 4 5 6 7 8 9 10 11 |
@{ ViewBag.Title = "Events"; } <h2>Events</h2> <button id="1" style="margin:10px" onclick="OnClick()"> В теге элемента </button><br> <button id="2" style="margin:10px"> Прямое присваивание </button><br> <button id="3" style="margin:10px" > Через EventListener </button><br> <script src='@Url.Content("~/Scripts/Events.js")' type="text/javascript"></script> |
Более подробно
Posted in C#
Comments Off on C#.Mvc.Js.Events
C#.MVC.JS.Prototypes
Прототипы позволяют добавлять свойства и методы в описание объекта. Prototype.js
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
function Dog(name, breed, weight) { this.name = name; this.breed = breed; this.weight = weight; } Dog.prototype.color = 'brown'; Dog.prototype.Run = function () { alert('Woof! I am running '); } document.getElementById('1').onclick = function () { var Rex = new Dog ('Rex', 'Mixed', 38); for (var p in Rex) { document.getElementById('target').innerHTML = document.getElementById('target').innerHTML + p + ':' + Rex[p] + '<br>'; } } |
Представление
Posted in C#
Comments Off on C#.MVC.JS.Prototypes
C#.MVC.JS.DomExamples
Создадим и поместим этот файл dom.js
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
function initText() { document.getElementById('target').innerHTML = 'initText'; document.getElementById('target').setAttribute("style", "color:black"); } function newText() { document.getElementById('target').innerHTML = 'newText'; } function newAttributes() { document.getElementById('target').setAttribute("style","color:red"); } document.getElementById('1').onclick = function () { initText(); } document.getElementById('2').onclick = function () { newText(); } document.getElementById('3').onclick = function () { newAttributes(); } |
Представление
Posted in C#
Comments Off on C#.MVC.JS.DomExamples
C#.MVC.JS.Создание объекта.Примеры
Создание объекта в функции Создадим objects.js в папке Scripts нашего проекта
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
//Создание простого объекта внутри функции function CreateFiat() { var fiat = { make: "Fiat", model: "500", year: 1957, color: "Medium Blue", passengers: 2, convertible: false, mileage: 88000, started: false, //Далее пошли методы объекта start: function () { this.started = true; // слово this необходимо, потому что мы вызываем свойство started оъекта fiat }, stop: function () { this.started = false; }, drive: function () { if (this.started == true) { alert('zoom zoom'); } else if (this.started == false) { alert('You need to start an engine'); } } }; //Тестируем методы объекта fiat.start(); fiat.drive(); } // Ставим обработчик на кнопку, чтобы скрипт срабатывал только при нажатии document.getElementById('MyButtonID').onclick = function () { CreateFiat(); }; |
Здесь у нас пример создания автомобиля fiat и подключение обработчика onclick, но этот способ подключения обработчика у меня не срабатывал. Поэтому я попробовал onclick тега самой кнопки, и … Continue reading
Posted in C#
Comments Off on C#.MVC.JS.Создание объекта.Примеры
C#.Ajax. Поиск через json
Источник Метод контроллера
|
1 2 3 4 5 6 |
public JsonResult JsonSearch(string name) { BookContext db = new BookContext(); var jsondata = db.Books.Where(a => a.Author.Contains(name)).ToList<Book>(); return Json(jsondata, JsonRequestBehavior.AllowGet); } |
Форма
Posted in C#
Comments Off on C#.Ajax. Поиск через json
C#. Ajax. Формы
Практика по ресурсу Metanit Ajax позволяет работать с данными без перезагрузки страницы. 2 контроллера
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
[HttpGet] public ActionResult BookSearch() { return View(); } [HttpPost] public ActionResult BookSearch(string name) { BookContext db = new BookContext(); var allbooks = db.Books.Where(a => a.Author.Contains(name)).ToList(); if (allbooks.Count <= 0) { return HttpNotFound(); } return PartialView("~/Views/Book/BookSearchPartial.cshtml", allbooks); } |
Представление для поиска
Posted in C#
Comments Off on C#. Ajax. Формы
С#. Фильтрация данных
Практика по ресурсу Metanit Модели
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
public class Player { public int Id { get; set; } public string Name { get; set; } public int Age { get; set; } public string Position { get; set; } public int? TeamId { get; set; } public Team Team { get; set; } } public class Team { public int Id { get; set; } public string Name { get; set; } public string Coach { get; set; } public ICollection<Player> Players { get; set; } public Team() { Players = new List<Player>(); } } |
Модель для фильтрации
Posted in C#
Comments Off on С#. Фильтрация данных
С#. MVC. Paginator
Практика по ресурсу Metanit Модель
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace modelsTraining2.Models { public class Phone { public int Id { get; set; } public string Model { get; set; } public string Producer { get; set; } } } |
Контроллер
Posted in C#
Comments Off on С#. MVC. Paginator
C#. Миграция
При изменении модели и контекста в VisualStudio при старте приложения у нас могут возникать ошибки, чтобы этого избежать, нам нужно проделать следующее Tools -> NugetPackageManager – > PackageManagerConsole И далее последовательно выполнить 3 инструкции
|
1 2 3 |
PM> Enable-Migrations -ContextTypeName modelsTraining2.Models.UserContext PM> Add-Migration "MigrateDB" PM> Update-Database |
После выполнения второй у нас … Continue reading
Posted in C#
Comments Off on C#. Миграция
C#.MVC.Модели со связью многие ко многим
Создадим в базе 3 таблички – Students, Courses и коммутационную CourseStudent Students Courses
Posted in C#
Comments Off on C#.MVC.Модели со связью многие ко многим