У нас вы можете посмотреть бесплатно Windows Application tutorial using c#:Part 1:Uploading a File and store it in db или скачать в максимальном доступном качестве, видео которое было загружено на ютуб. Для загрузки выберите вариант из формы ниже:
Если кнопки скачивания не
загрузились
НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если возникают проблемы со скачиванием видео, пожалуйста напишите в поддержку по адресу внизу
страницы.
Спасибо за использование сервиса ClipSaver.ru
Pls subscribe my channel Here i'm gonna show you how to create a db and how to connect to it, how to use OpenFileDialog and copy the file to the project location and store the file details to the database source code: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using System.IO; using System.Data.SqlClient; namespace upload_image_and_retrive { public partial class Form1 : Form { SqlConnection con = new SqlConnection(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=c:\users\akash\documents\visual studio 2012\Projects\upload image and retrive\upload image and retrive\Database1.mdf"); SqlCommand cmd; public Form1() { InitializeComponent(); } private void button1_Click_1(object sender, EventArgs e) { DialogResult result = openFileDialog1.ShowDialog(); // Show the dialog. if (result == DialogResult.OK) // Test result. { string file = openFileDialog1.FileName; string[] f = file.Split('\\'); // to get the only file name string fn = f[(f.Length) - 1]; string dest = @"C:\Users\Akash\Documents\visual studio 2012\Projects\upload image and retrive\upload image and retrive\images\" + fn; //to copy the file to the destination folder File.Copy(file, dest, true); //to save to the database string q = "insert into [data_file] values('" + fn + "','" + dest + "')"; cmd = new SqlCommand(q, con); con.Open(); cmd.ExecuteNonQuery(); MessageBox.Show("success"); } } } }