Logo video2dn
  • Сохранить видео с ютуба
  • Категории
    • Музыка
    • Кино и Анимация
    • Автомобили
    • Животные
    • Спорт
    • Путешествия
    • Игры
    • Люди и Блоги
    • Юмор
    • Развлечения
    • Новости и Политика
    • Howto и Стиль
    • Diy своими руками
    • Образование
    • Наука и Технологии
    • Некоммерческие Организации
  • О сайте

Скачать или смотреть 1 Setting up Visual Studio

  • Jonathan Dittman
  • 2025-07-01
  • 14
1 Setting up Visual Studio
  • ok logo

Скачать 1 Setting up Visual Studio бесплатно в качестве 4к (2к / 1080p)

У нас вы можете скачать бесплатно 1 Setting up Visual Studio или посмотреть видео с ютуба в максимальном доступном качестве.

Для скачивания выберите вариант из формы ниже:

  • Информация по загрузке:

Cкачать музыку 1 Setting up Visual Studio бесплатно в формате MP3:

Если иконки загрузки не отобразились, ПОЖАЛУЙСТА, НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если у вас возникли трудности с загрузкой, пожалуйста, свяжитесь с нами по контактам, указанным в нижней части страницы.
Спасибо за использование сервиса video2dn.com

Описание к видео 1 Setting up Visual Studio

Setting up a Visual Studio Forms app in C#.

Here is the code you will need:
//------------------------------------------------------------------------------------------
using Microsoft.Data.SqlClient;
using System.Data;

class Database
{
// TODO - this needs to be changed to your connection string
private string connectionStr = "this needs to change";
// this allows create and insert sql commands to be executed


// creates a table in a database. Returns true if the table was created. False if the table
// already exists or there was an error
public bool CreateTable(string sql)
{
bool retVal = true;
try
{
ExecuteNonQuery(sql);
}
catch
{
retVal = false;
}

return retVal;
}

// Inserts data into a table. Returns true if it worked, false if not
public bool Insert(string sql)
{
bool retVal = true;
try
{
ExecuteNonQuery(sql);
}
catch
{
retVal = false;
}

return retVal;
}

// Select data from a table, returned as a DataTable
public DataTable Select(string sql)
{
DataTable dataTable = new DataTable();

using (SqlConnection connection = new SqlConnection(connectionStr))
{
connection.Open();
using (SqlCommand command = connection.CreateCommand())
{
command.CommandText = sql;

// create data adapter
using (SqlDataAdapter dataAdapter = new SqlDataAdapter(command))
{
// this will query your database and return the result to your datatable

dataAdapter.Fill(dataTable);
connection.Close();
}
}

}
return dataTable;
}

// if Id is used as the primary key, returns the integer value of the next available value
public int GetNextId(string tableName)
{
int retVal = 1;
using (SqlConnection connection = new SqlConnection(connectionStr))
{
connection.Open();
SqlCommand command = connection.CreateCommand();
command.CommandText = "SELECT MAX(Id) FROM " + tableName;
using (SqlDataReader reader = command.ExecuteReader())
{
try
{
if (reader.Read())
{
retVal = reader.GetInt32(0) + 1;
}
reader.Close();
}
catch
{
reader.Close();
retVal = 1;
}
}
connection.Close();
}
return retVal;
}


public void DeleteTable(string tableName)
{
ExecuteNonQuery("DROP TABLE " + tableName);
}

private void ExecuteNonQuery(string sql)
{
using (SqlConnection connection = new SqlConnection(connectionStr))
{

connection.Open();
SqlCommand command = connection.CreateCommand();
command.CommandText = sql;
command.ExecuteNonQuery();
}
}

}

Комментарии

Информация по комментариям в разработке

Похожие видео

  • О нас
  • Контакты
  • Отказ от ответственности - Disclaimer
  • Условия использования сайта - TOS
  • Политика конфиденциальности

video2dn Copyright © 2023 - 2025

Контакты для правообладателей [email protected]