-1-
   
      
-2-
   
    
    
    
 
0127  قراءة محتوى ملف Excel وعرضه في أداة DataGridView بلغة سي شارب 
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.Data.OleDb;
using System.IO;
namespace excel_file_in_data_grad_view2
{
    public partial class Form1 : Form
    {
        OleDbConnection con;
        OleDbDataAdapter da;
        DataTable dt;
        public Form1()
        {
            InitializeComponent();
        }
        private void Form1_Load(object sender, EventArgs e)
        {
        }
        private void button1_Click(object sender, EventArgs e)
        {
            string filePath = string.Empty;
            string fileExt = string.Empty;
            OpenFileDialog op = new OpenFileDialog(); //open dialog to choose file  
            if (op.ShowDialog() == DialogResult.OK) //if there is a file choosen by the user  
            {
                filePath = op.FileName; //get the path of the file  
                fileExt = Path.GetExtension(filePath); //get the file extension  
                if (fileExt.CompareTo(".xls") == 0 || fileExt.CompareTo(".xlsx") == 0)
                {
                    try
                    {
                        con =new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + filePath + ";Extended Properties=Excel 8.0"); //for below excel 2007  
                        da = new OleDbDataAdapter("select * from [cam$]", con);
                        dt = new DataTable();
                        da.Fill(dt);
                        dgv.DataSource = dt;
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message.ToString());
                    }
                }
                else
                {
                    MessageBox.Show("Please choose .xls or .xlsx file only.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Error); //custom messageBox to show error  
                }
            }
        }
        private void dgv_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
        }
    }
}
| اسم الملف | لينك | 
|---|---|
| 0090 Graphics Draw Image Method c sharp part3 | https://youtu.be/WRa9GQJZaz0 | 
| 0091 Draw Curve Draw Closed Curve Draw Path Draw Draw Image Unscaled And Clipped c sharp | https://youtu.be/VfFHmpzJ4J4 | 
| 0092 Graphics Copy From Screen c sharp | https://youtu.be/96xvrmv_sjA | 
| 0093 Graphics Draw Rectangles Draw Bezier bezier Points Draw Icon Draw Icon Unstretched | https://youtu.be/BQzoR-Inc34 | 
| 0094 Graphics Fill Rectangle Fill Ellipse fill Region Fill Pie Fill Closed Curve c sha | https://youtu.be/6nB3d21jzlg | 
| 0095 printDialog printPreviewDialog printDocument | https://youtu.be/qzAGzQ7-8b0 | 
| 0096 printDialog printPreviewDialog printDocument part2 | https://youtu.be/d_CiscdaGHU | 
| 0097 printDialog printPreviewDialog printDocument many pages part3 | https://youtu.be/nikdq10AeT8 | 
| 0098 printDialog printPreviewDialog printDocument many pages from … | https://youtu.be/x0CJkLoiSc4 | 
| 0099 printDialog printPreviewDialog printDocument print panel part5 | https://youtu.be/LSXS7jhMw9w | 
| 0100 Bitmap class read create load Save Bitmap | https://youtu.be/-I_4CdmyNpw | 
| 0101 Bitmap class extract pixel component ARGB and set grayscale mode c sharp | https://youtu.be/m8LFpMbai9M | 
| 0102 Bitmap class extract pixel component ARGB and set negative mode and reverse it c sharp | https://youtu.be/UsbAZDbEbzI | 
| 0103 Bitmap class عمل مجموعة من الصور وحفظها وعرضها فتظهر متحركة و عمل دالة لتحويل الصورة لنج | https://youtu.be/NiVLRXBRXHc | 
| 0104 Bitmap class عمل مجموعة من الصور وحفظها وعرضها فتظهر متحركة part1 | https://youtu.be/WK5yNzSVjOA | 
| 0105 Bitmap class عمل مجموعة من الصور وحفظها وعرضها فتظهر متحركة part2 | https://youtu.be/jWu3dxWsb3c | 
| 0106 Bitmap class عمل مجموعة من الصور وحفظها وعرضها فتظهر متحركة part3 | https://youtu.be/BPLMH0SNw_Q | 
| 0107 Bitmap class ساعة بعقارب بخلفية متحركة كل 5 ثوانى | https://youtu.be/zsECjkupFKA | 
| 0108 Bitmap class ساعة بعقارب بخلفية متحركة كل 5 ثوانى part1 | https://youtu.be/2NAoUTJA3fc | 
| 0109 Bitmap class ساعة بعقارب بخلفية متحركة كل 5 ثوانى part2 | https://youtu.be/LSXS7jhMw9w | 
| 0110 Bitmap class فكرة رسم العقارب باستخدام draw pie ساعة بعقارب مثال 2 جزء 1 | https://youtu.be/-0Dq960q75w | 
| 0111 Bitmap class فكرة رسم العقارب باستخدام draw pie ساعة بعقارب مثال 2 جزء2 | https://youtu.be/GK1tNN4ZXgE | 
| 0112 Bitmap class فكرة رسم العقارب باستخدام draw pie ساعة بعقارب مثال 2 جزء3 | |
| 0113 bitmap class Image Viewer and effects عارض الصور والتأثيرات | https://youtu.be/yuuR8cvQsEo | 
| 0114 bitmap class ImageViewer and effects exampl عارض الصور والتأثيرات c sharp part1 | https://youtu.be/rXxkPuTyjF4 | 
| 0115 bitmap class ImageViewer and effects c sharp عارض الصور والتأثيرات part2 | https://youtu.be/4hRLncZhsMg | 
| 0116 bitmap class ImageViewer and effects c sharp عارض الصور والتأثيرات part3 | https://youtu.be/s1OE7kVNCaQ | 
| 0117 bitmap class ImageViewer and effects c sharp عارض الصور والتأثيرات part4 | https://youtu.be/NF1OF_wa4qo | 
| 0118 bitmap class ImageViewer and effects mirror c sharp عارض الصور والتأثيرات part5 | https://youtu.be/wXz93xyD5zc | 
| 0119 bitmap class ImageViewer and effects Rotate Flip type c sharp عارض الصور والتأثيرات part6 | https://youtu.be/0fDVs7cgvhw | 
| 0120 bitmap class ImageViewer and effects Rotate any angle c sharp عارض الصور والتأثيرات part7 | https://youtu.be/DmxCuv_DTiw | 
| 0120 bitmap class ImageViewer and effects Rotate any angle c sharp عارض الصور والتأثيرات part8 | https://youtu.be/Il_mHKxHQyU | 
| 0122 تعامل سى شارب مع الاكسيل قراءة محتويات ملف اكسيل وعرضها بنظام على form | https://youtu.be/XOhB7AhNS-I | 
| 0123 تعامل سى شارب مع الاكسيل انشاء ملف و الكتابة فية و تنسيق الخلية وحفظ الملف | https://youtu.be/lHOVwBmQZ9A | 
| 0124 تعامل سى شارب مع الاكسيل حفظ الملف بامتدادات مختلفة وعمل ترتيب ل نطاق من الخلايا | https://youtu.be/KwPXN29AbyQ | 
| 0125 تعامل سى شارب مع الاكسيل كتابة المعادلات و تطبيقها على الخلايا | https://youtu.be/GEonFQU-_5s | 
| 0126 تعامل سى شارب مع الاكسيل انشاء شيت جديد و نسخ محتويات شيت قديم فيه | https://youtu.be/sfvRsT--2Pk | 
| 0127 قراءة محتوى ملف Excel وعرضه في أداة DataGridView بلغة سي شارب | https://youtu.be/DvE1yulGTu4 | 
| 38 | 37 | 
-3-
  
    
    
    
 
-4-