Excel File to DataGridView Import | C# | WinForms | Part One

แชร์
ฝัง
  • เผยแพร่เมื่อ 18 พ.ย. 2024

ความคิดเห็น • 30

  • @LearnHowTo365
    @LearnHowTo365  2 ปีที่แล้ว

    PLEASE READ CAPTION AND MAKE SURE TO SUBSCRIBE ❤, YOU CAN SIMPLY CLICK ON THIS LINK BELOW
    🔗 bit.ly/3Pakd48

  • @martinmanalansan8941
    @martinmanalansan8941 2 ปีที่แล้ว

    This is the easiest and clear guide to import excel to datagridview. Good job! Keep up the good work!

    • @LearnHowTo365
      @LearnHowTo365  2 ปีที่แล้ว

      Thank you so much , actually this was the hard you can find the easy way in its description or just watch this video for the most easiest method: th-cam.com/video/ZGEA20geWrQ/w-d-xo.html

  • @learningscripts7466
    @learningscripts7466 2 ปีที่แล้ว +3

    So far the most detailed and easy to follow tutorial I encountered. Can you also create an EXPORT and Report Tutorial from the Data Grid please? That would be so much appreciated! Cheers keep it up!

    • @LearnHowTo365
      @LearnHowTo365  2 ปีที่แล้ว

      Hey AT here again and thanks for your comment and kind words...
      I did what you asked and uploaded the easy way to export from datagridview
      and here is the LINK : th-cam.com/video/6lJtrBpV0Ws/w-d-xo.html
      HOPE YOU ENJOY! ❤❤

  • @raidsmail5638
    @raidsmail5638 ปีที่แล้ว +1

    very informative and clear thank you so much :) (you can make the first sheet chosen automatically by using the code xlWS = (Microsoft.Office.Interop.Excel.Worksheet)xlWB.Worksheets.Item[1]; where xlWS = xlworksheet and xlWB xlworkbook as the sheet name changes from excel file to another this way you can select automatically the first sheet or you can change n with number to go to in .item[n] to make more wide choice to the user ) and thank you again

    • @LearnHowTo365
      @LearnHowTo365  ปีที่แล้ว +1

      Hey thanks for the tip I will add your tip to the description as soon as possible... But if you are looking for the easier way, watch the next video... its as simple as copy-paste-ing

  • @H15_D14
    @H15_D14 2 ปีที่แล้ว +1

    Thank you for a simple and clear tutorial! I'm really tired of looking for information on how to do it right. (It was really hard...)

    • @LearnHowTo365
      @LearnHowTo365  2 ปีที่แล้ว +2

      Thanks buddy, I too looked for the easiest one when I was searching for it. But there is another video in my channel that is the real simple way, check that out as well

  • @yairramirezgaona7153
    @yairramirezgaona7153 ปีที่แล้ว

    It was an amazing video.

    • @LearnHowTo365
      @LearnHowTo365  ปีที่แล้ว

      Thank you.. I suggest you watch the easy way as well

  • @shivajisuryavanshi8431
    @shivajisuryavanshi8431 ปีที่แล้ว +2

    How do we validate the data of Excel file while loading it to the grid view like contact number must have 10 degit n dob has some mm.dd.yyyy format

    • @LearnHowTo365
      @LearnHowTo365  ปีที่แล้ว

      Well Thats kinda tricky you have to add an extra "if" line of code to count the characters of the string that is coming from the excel something like:
      if (dataComing.TextLength == 10)
      And For the date... I have no clue right no :)

  • @riku_dola8079
    @riku_dola8079 2 ปีที่แล้ว +1

    Hi, would it possible to use specifically choose certain columns of a table from the excel file? Because in this video you're just extracting all columns with the excel range, and I would like to find out if I can choose specific columns by their column name within the excel range. Like for example at 9:05 I need
    only the 1st, 2nd and 4th column.
    I know there's an easier method but I need to use the harder method.

    • @LearnHowTo365
      @LearnHowTo365  2 ปีที่แล้ว +1

      Hey thanks for your comment.. I guess there is a way... check out the next video which is the easy way to import from excel using sql command line.. of course in this solution you can do the thing you want as well you just have to know about the column name and it's index...
      Then you need to have separate loops tk exract thay specific column... I strongly recommend you watch the next video
      Here is the link to it :
      th-cam.com/video/ZGEA20geWrQ/w-d-xo.html

  • @shivajisuryavanshi8431
    @shivajisuryavanshi8431 ปีที่แล้ว +1

    Thank you man😇

  • @정회준-u7i
    @정회준-u7i ปีที่แล้ว +1

    Thank you for showing us a fun video. I was copying this video and got stuck at this part. xlrange=xlworkbook.Worksheets["Sheets"];

    • @LearnHowTo365
      @LearnHowTo365  ปีที่แล้ว

      Hmm... hey don't mention it... it's kinda like you didn't install the perquisites or you are missing something... if you didn't find the answer.. comment and reply again and I will check my code for you 🌹

    • @paulinedonor
      @paulinedonor ปีที่แล้ว +1

      @@LearnHowTo365 same issue here, is there other way to fix it?

    • @LearnHowTo365
      @LearnHowTo365  ปีที่แล้ว

      @PaulineLDonor I just checked my code, and i don't think you are copying it right.. or there might be a mistake from my side in the video.. I have to double-check it.. BUT, as far as I know, for the variable "xlrange" you a assigning the wrong expression.
      This is the correct one :
      xlrange = xlworksheet.usedrange

  •  2 ปีที่แล้ว +1

    how do i make a seach function to be able to search in the data grid?

    • @LearnHowTo365
      @LearnHowTo365  2 ปีที่แล้ว

      Greeting, this video isnt made for that... but if you are getting your Data from a database then you need to use the Textbox_TextChanged event (assuming you have a textbox to input search parameters) then it is only the matter of SQL on your database to perform a search query

  • @rajdipdas316
    @rajdipdas316 ปีที่แล้ว

    How do I get for the multiple sheet? This is for only for one sheet at a time we can access....!!! Help me to do for the multiple sheet present in an excel??

    • @LearnHowTo365
      @LearnHowTo365  ปีที่แล้ว

      Hey.. so do you see the part in "try" section where you assign "sheet1" to the variable called " xlworksheet"? There. You have to create a loop statement to iterate excel file sheets.. and for each sheet, you have to do the main function which imports the whole data.. but be careful this will add them to the existing datagridview

    • @rajdipdas316
      @rajdipdas316 ปีที่แล้ว +1

      Thanks for the reply ... I implemented already😄

    • @rajdipdas316
      @rajdipdas316 ปีที่แล้ว +1

      One more thing I want to ask is xl range.cell[xlrow,1] cant we make it in a generalised format?? Like what I am trying to say is that I don't want to put 1,2,3 everytime inside xlrange.cell..

    • @LearnHowTo365
      @LearnHowTo365  ปีที่แล้ว

      @@rajdipdas316 oh.. sorry then 🌹🌺

    • @LearnHowTo365
      @LearnHowTo365  ปีที่แล้ว

      @@rajdipdas316 I don't quite get it.. have you implemented it already? Or if not yet then explain it more for me 🌺