UiPath | Filter DataTable using LINQ Query | Handle Exception The source contains no DataRows

แชร์
ฝัง
  • เผยแพร่เมื่อ 17 ม.ค. 2025

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

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

    📝 𝗟𝗜𝗡𝗤 𝗩𝗶𝗱𝗲𝗼𝘀
    𝗔. 𝗣𝗔𝗥𝗧𝗜𝗧𝗜𝗢𝗡 𝗢𝗣𝗘𝗥𝗔𝗧𝗢𝗥𝗦
    ➊ 𝗧𝗔𝗞𝗘: th-cam.com/video/PnaylK37gLE/w-d-xo.html
    ➋ 𝗦𝗞𝗜𝗣: th-cam.com/video/RDQ9CrtumKU/w-d-xo.html
    ➌ 𝗧𝗔𝗞𝗘𝗪𝗛𝗜𝗟𝗘: th-cam.com/video/nM6oYFLMjfU/w-d-xo.html
    ➍ 𝗦𝗞𝗜𝗣𝗪𝗛𝗜𝗟𝗘: th-cam.com/video/sMSMmIGOsuQ/w-d-xo.html
    𝗕. 𝗣𝗥𝗢𝗝𝗘𝗖𝗧𝗜𝗢𝗡 𝗢𝗣𝗘𝗥𝗔𝗧𝗢𝗥𝗦
    ➊ 𝗦𝗘𝗟𝗘𝗖𝗧: th-cam.com/video/DIx0SsRML9o/w-d-xo.html
    ➋ 𝗦𝗘𝗟𝗘𝗖𝗧𝗠𝗔𝗡𝗬: th-cam.com/video/fo9GD6rTJTA/w-d-xo.html
    𝗖. 𝗙𝗜𝗟𝗧𝗘𝗥𝗜𝗡𝗚 𝗢𝗣𝗘𝗥𝗔𝗧𝗢𝗥𝗦
    ➊ 𝗪𝗛𝗘𝗥𝗘: th-cam.com/video/97bM7c_Z3c4/w-d-xo.html
    𝗗. 𝗤𝗨𝗔𝗡𝗧𝗜𝗙𝗜𝗘𝗥 𝗢𝗣𝗘𝗥𝗔𝗧𝗢𝗥𝗦
    ➊ 𝗔𝗟𝗟: th-cam.com/video/v_HbqcaeitI/w-d-xo.html
    ➋ 𝗔𝗡𝗬: th-cam.com/video/ushKsJAXRT8/w-d-xo.html
    𝗘. 𝗘𝗟𝗘𝗠𝗘𝗡𝗧 𝗢𝗣𝗘𝗥𝗔𝗧𝗢𝗥𝗦
    ➊ 𝗘𝗹𝗲𝗺𝗲𝗻𝘁𝗔𝘁: th-cam.com/video/IxpF7l1vCXg/w-d-xo.html
    ➋ 𝗘𝗹𝗲𝗺𝗲𝗻𝘁𝗔𝘁𝗢𝗿𝗗𝗲𝗳𝗮𝘂𝗹𝘁: th-cam.com/video/IxpF7l1vCXg/w-d-xo.html
    ➌ 𝗙𝗶𝗿𝘀𝘁: th-cam.com/video/Ja-9dFEl6js/w-d-xo.html
    ➍ 𝗙𝗶𝗿𝘀𝘁𝗢𝗿𝗗𝗲𝗳𝗮𝘂𝗹𝘁: th-cam.com/video/Ja-9dFEl6js/w-d-xo.html
    ➎ 𝗟𝗮𝘀𝘁: th-cam.com/video/-5MQ3viVnY0/w-d-xo.html
    ➏ 𝗟𝗮𝘀𝘁𝗢𝗿𝗗𝗲𝗳𝗮𝘂𝗹𝘁: th-cam.com/video/-5MQ3viVnY0/w-d-xo.html

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

    The BEST channel to learn LINQ use cases for UiPath. Very well explained. Thank you "UiPath - Mahmoud TV"!!

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

      Thanks alot Sri Vasavi, happy to hear that :)

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

      @@ActAutomate Hi i have following Text in a Notepad:
      This is Jim
      Jim is teaching VBScript
      Jim will also teach UiPath
      Jim will travel
      i need count of word Occurances say word called "This" has occurred only once so "This -1", word called Jim occurred 4 times so "Jim -4" like that whatever text i keep i need count of each word
      i tried with this - its somewhat working -
      array_Tst.GroupBy(function (x) x.ToUpper).ToDictionary(function (x) x.Key, function (x) x.Count)
      but i copied the syntx from google which i did not understand so checking any other wya we can do it.. pls help

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

    Easily on my top 3 LINQ tutorials online. Thanks a lot!

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

      Very happy to hear that 🔥

  • @skmNas
    @skmNas 7 หลายเดือนก่อน +1

    You explain each topic so well like from a basic to an advance level, Please do continue the UiPath API Automation Series and also advanced topics of UiPath. Looking forward for more videos and more Knowledge gain from you. Thank you for the LINQ topics.

    • @ActAutomate
      @ActAutomate  7 หลายเดือนก่อน

      Thanks for your feedback, really happy to hear that :-)

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

    Got detailed Understanding of Linq!!Thank You!!

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

      You're welcome Aparna :-)

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

    You are awesome!😃

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

      Thanks a lot Jessé 😃

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

    Very useful video on linq, thx a lot !

  • @f-alzahraa_Ahmed
    @f-alzahraa_Ahmed 11 หลายเดือนก่อน +1

    real thanks dude🙏🙏🤞🤞

    • @ActAutomate
      @ActAutomate  11 หลายเดือนก่อน

      you're welcome Fatima :-)

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

    Thank you Sir. Very nice teaching ☺️.

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

    fantastic, superb... if you start class tell me am interested

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

      Sure, it will be in the next months during this year, still not sure when exactly, but I will tell you that here on TH-cam and LinkedIn ;-)

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

      @@ActAutomate simply your teaching skills and way of explanation amazing.. i need UI path...

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

      @@rasipogulabhaskar9858 It will be about UiPath in general, and about LINQ in details

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

      @@rasipogulabhaskar9858 Thanks ☺

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

    When it comes to that no data Ross exception i prefer to assign query results to a variable of Ienumerable of datarow and then checking its content with .Any methods, if it is true i then use .copytodatatable methods on that Ienumerable variable.

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

      Thanks Drzymala for the info.
      As mentioned there are different ways to handle this exception and I prefer to use Try Catch.
      But if many are interested to learn how to handle the exception in different ways, I could create a video about that!
      Just let me know ;-)

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

      @@ActAutomate Hi, Please Create More Videos For The Same.

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

      @@ankitmehta54 I will do that in the video: LINQ - ANY Function
      Just wait for it ;-)

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

    19:08
    "we need to use CStr method to converst the conent to string"
    why ? you was already using row(Country).ToString ?! .. what is the difference between CStr and ToString and why did you use both of them ?

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

      Ah sorry, I used the both, but you only need one of them in this case, because you want to convert to string.
      So you either use:
      Where row("Country").ToString.IsNumeric
      or:
      Where CStr(row("Country")).IsNumeric
      But if you want to convert to another data type, you have to use .ToString, and also the function at the beginning.
      I mean if you want to convert to Integer, you use the following:
      CInt(row("Country").ToString)
      ToDouble:
      CDbl(row("Country").ToString)
      So you need to get the content of the row as string using .ToString
      Then you convert to integer for example using CInt
      But as mentioned, if you want to convert to string, then only once is enough, either .ToString or CStr
      Both functions have the same result, no difference between the both!
      Thanks for the comment and the hint :-)

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

      @@ActAutomate now i get it , thanks for explaining , Keep up the good work!

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

      @@abdelrahmanbadr2404 You're welcome Abdelrahman.
      We are happy that you are active in the channel and ask very useful questions. Kepp up also the good questions and share the knowledge with your friends.
      Great to have you here :)

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

      @@ActAutomate that's very kind of you :)

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

    Hi i have following Text in a Notepad:
    This is Jim
    Jim is teaching VBScript
    Jim will also teach UiPath
    Jim will travel
    i need count of word Occurances say word called "This" has occurred only once so "This -1", word called Jim occurred 4 times so "Jim -4" like that whatever text i keep i need count of each word
    i tried with this - its somewhat working -
    array_Tst.GroupBy(function (x) x.ToUpper).ToDictionary(function (x) x.Key, function (x) x.Count)
    but i copied the syntx from google which i did not understand so checking any other wya we can do it.. pls help

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

      You need to do the following:
      First you have to define the words as whole words. Each word will be with an empty space after it, or with a point, comma, new line, etc.
      Then you can write the query you have. It should work.
      At the end you can either print out the result of write it to a text file or something else.
      Here is the complete code:
      ' Normalize and split the text into words
      Dim words = text.Split(New Char() {" "c, vbCr, vbLf, vbTab, ","c, "."c, ";"c, ":"c, "!"c, "?"c},
      StringSplitOptions.RemoveEmptyEntries)
      ' Use LINQ to group and count the words
      Dim wordCounts = words _
      .GroupBy(Function(w) w.ToUpperInvariant()) _
      .ToDictionary(Function(g) g.Key, Function(g) g.Count())
      ' Iterate through the dictionary and print out each word and its count
      For Each wordCount In wordCounts
      Console.WriteLine("{0} - {1}", wordCount.Key, wordCount.Value)
      Next
      In case you only copy the code and it doesn't work, then you have to do the following:
      Under Imports tab (next to Variables, Arguments) import the following namespaces:
      System.LINQ
      System.Collections.Generic
      System.XML.LINQ
      Or to make it easier:
      Just write the code (DON'T COPY). Once you write the code, the needed imports will be added to your workflow automatically.
      Please let my know if you still need help!☺

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

    If Possible, can u suggest me the best resource for learning Linq queries from A to Z.

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

      Unfortunately I don't know any source for that. There are many websites for LINQ, but I don't know which is the best one or where you can find everything, especially about LINQ in UiPath.
      Maybe you can search for a course on Udemy or LinkedIn
      I will also Create a full course about LINQ on Udemy using VB and C# with some material etc. where you can learn LINQ from A to Z
      For now you can check the videos on my channel. There are many videos about LINQ.

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

    You have a perfect video series about LINQ, thanks a lot. But California and Texas are not the cities :)

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

      Thanks for info. I didn't think about that, just wrote some names (Cities or States) :-)

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

    Is that vb or C#?

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

      It's VB

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

      @@ActAutomate oh I see, do you have any video in C#?

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

      @@Gilgameshx Unfortunately not at the moment.
      Currently I am only posting about Linq using VB.
      Later I will do the same using C#
      For now you can use any online converter to convert the code from VB to C#
      For example this one: converter.telerik.com/

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

      @@ActAutomate awesome!

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

    🔥🔥🔥

  • @preetikarauthan9096
    @preetikarauthan9096 11 หลายเดือนก่อน +1

    Hello act automate,
    Really liked your videos on linq ..amazing explanation given .
    Can u please create a video on how to sort any integer array asc or desc.
    Thankyou!

    • @ActAutomate
      @ActAutomate  11 หลายเดือนก่อน

      Please check the following videos:
      th-cam.com/video/VWbE6atf9W8/w-d-xo.html
      th-cam.com/video/X8QwzuKc3Hw/w-d-xo.html
      th-cam.com/video/phQFwZQ608M/w-d-xo.html
      These are about Order and Then methods, which can be used to sort in ascending and descending.
      If you still have any question, please write me back.

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

    18:11 Mahmoud, this code giving me compiling error.

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

      Did you get the answersll? I didn't get that too

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

      @@ZidanMhmd use the following code.
      (
      From row In dt_Input
      From col In dt_Input.Columns.Cast(Of DataColumn)
      Where Not String.IsNullOrEmpty(row(col).ToString)
      Select row
      ).Distinct.CopyToDataTable

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

      Thanks for the answer. This is correct. I just wrote the expression wrong. Normally we should use it always in this way:
      String.IsNullOrEmpty(YourStringVariable)
      Not String.IsNullOrEmpty(YourStringVariable)
      and so on
      The other one causes errors in case of DBNull etc.

    • @khaledbinjameel9639
      @khaledbinjameel9639 2 หลายเดือนก่อน

      I'm having that error too

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

    nice

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

    If possible please teach us lamda function and more complex problem solving skills using linq like how to filter multiple columns in a single dataset and their Approaches like Array to list etc . mean while please teach us most complex real time senario based dataset manipulations.

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

      Since u already demonstrated filtering multiple columns ,please ignore from above line.

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

      I will try to do that Sam.
      If you have specific examples, please let me know!

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

    Hi.. Nice Video.. i want know compare the two datatable.. can expalin tolist, to array, etc... to copydatatable..in the possible way...

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

      Sorry I didn't understand the question. Can you please explain more what you want to learn?!

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

      @@ActAutomate
      Linq is Powerful tool to access data from different sources and methods. To get data requirement details. So that I want to know more about linq can you explain all operators in linq?
      Aggregation --Aggregate, Average, Count, LongCount, Max, Min, Sum
      Conversion --AsEnumerable, Cast, OfType, ToArray, ToDictionary, ToList, ToLookup
      Element--ElementAt, ElementAtOrDefault, First, FirstOrDefault, Last, LastOrDefault, Single, SingleOrDefault
      Generation --DefaultIfEmpty, Empty, Range, Repeat
      Grouping --GroupBy
      Join --Group Join, Join
      Ordering --Order By, OrderByDescending, Reverse, ThenBy, ThenByDescending
      Other --Concat, SequenceEqual, Zip
      Partitioning --Skip, SkipWhile, Take, TakeWhile
      Projection --Select, SelectMany
      Quantifiers -All, Any, Contains
      Restriction --Where
      Set--Distinct, Except, Intersect, Union
      etc.,
      You are using single data Table only, can you tell how to use more than one data table in linq.
      Can you explain all sequence above topics as soon as possible...? Because we are waiting for more than a month for this query… Note: No Coding Knowledge person also learns this query in easy way…
      By Pragash

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

      @@rpateam8623 Hi Pargash,
      All these topics are already on our ToDo list.
      I will explain all these topics in the next time. Just let me finish ReFramework Videos, then we can only post videos about LINQ.
      We need some help so that we can continue posting new videos, therefore we don't post more than one video pro week currently. There is no big audience etc.
      Please share channel with you friends and help us to improve our channel!

  • @LuisFernando-ux1ys
    @LuisFernando-ux1ys 2 ปีที่แล้ว +1

    Hello Act Automate!
    Today I come with a different question.
    How can I get de Last row index of a specific columnn in a Data Table? I have a data table which every column is completely independent from each other. which means that a column might have info till the row 9 where another column in the same dt has info till the row 4. Let me know if you understood my question. Thank you vey much once again.

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

      Hi Luis,
      I am happy to hear your questions, which give me new ideas for new videos!
      So I understood your question so:
      You have a datatable, which contains different columns and rows.
      Each row could have a content in each column, but it could be also empty in some columns.
      You want to get the last row index, where a specific column is filled it.
      For example, the table contains 10 rows, and 3 columns. The second column contains content in some rows only, and the last filled one is the 5th one. You want to get the index of this 5th row.
      Is it correct?
      You can also add some examples here, so that I can understand you better, and it's also good for the others, who could have the same question, so that they understand it and could use it in their projects!

    • @LuisFernando-ux1ys
      @LuisFernando-ux1ys 2 ปีที่แล้ว +1

      Forget it, it's just a simple linq query!!! Already solve it

    • @LuisFernando-ux1ys
      @LuisFernando-ux1ys 2 ปีที่แล้ว +1

      @@ActAutomate Yes is correct, What i actually did is this =
      Numero_Fila = (
      From row In dt_CostosGastos
      Where row(in_TipoGasto) IsNot Nothing
      Select row
      ).Select(Function(x) dt_CostosGastos.Rows.IndexOf(x)).ElementAtOrDefault(0)
      I was hoping to get the first empty row of the columnn name that is saved in "in_TipoGasto" but it always gives me 0 as result. What am I doing wrong?

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

      @@LuisFernando-ux1ys Very good!

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

      @@LuisFernando-ux1ys You want to get the first empty row using a column, or to get the first filled row, or to get the last filled?
      To make your query better, I recommend you to use the following function before ElementAtOrDefault operator:
      DefaultIfEmpty(-1).ElementAtOrDefault(0)
      In this way, if you don't have an index, you will get -1 as result. In this way you can differentiate between row index 0 and nothing (0) --> now it's -1

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

    Hi your way of teaching very nice.. Can you upload c# tutorials easy way.. If I become rpa developer should I learn c# right.. Atleast logic building purpose need c#.. Please if possible can you upload c#

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

      Thanks for commenting Thayalan :)
      Using C# you can do mostly everything. I need more specific need, what you want to learn exactly?
      For example rename excel sheet using C#, then I can explain it to you, etc.

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

      @@ActAutomate I want learn c# Tutorials beginer to medium level.. If u have video or let me best sites

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

    This is good but could you explain this, on the example 8 where we look each column, If each column is looping and creating additional rows why it is not creating additional rows at the place where we have column value in the rows where we have also found empty, While empty is being ignored the other values should also create an additional row right, Could you explain that by the way tried this one after completing all your Linq videos,
    (
    From Row In dtInput.Rows.Cast(Of System.Data.DataRow)
    Where Not Row.ItemArray.Any(Function(x) String.IsNullOrEmpty(x.Tostring.Trim))
    Select Row
    ).CopyToDataTable

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

      I didn't get your point. Do you want me to explain the example number 8 or your query?
      What is the question exactly? What do you want to understand?
      Please give me more details with examples or with the part of the code you are talking about.

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

    Hi bro, could u pls create a video on linq query updating the row value of one column with value if the another column row matches the value.
    Example "column1" which contains the value "Paper" then update "Column3" = "Scissors"

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

      Sure I will do that, but it will be later, after explaning the methods.
      It's also not easy to do like other use cases.

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

      @@ActAutomate thks bro appreciate your reply

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

      ☺@@balramraviks

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

    C# advance code use in Uipath

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

      Ketan, Sorry, I didn't get your point. Do you want the same in C# or do you mean something else?

  • @anilsingh-rd2fm
    @anilsingh-rd2fm ปีที่แล้ว

    0:34

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

      Do you want to say something?!

  • @SenthilKumar-ue8pr
    @SenthilKumar-ue8pr 2 ปีที่แล้ว +1

    Hi ,
    (From row In Linq
    Where row("ACTIVITY").ToString.contains("PV","DF","DD")
    Select row).CopyToDatatable how to implement multiple values

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

      You mean, you want to check, if the row contains any value from these three values ?
      You only have to change to Where Statement .
      Where row("ACTIVITY").ToString.Contains("PV") OrElse row("ACTIVITY").ToString.Contains("DF") OrElse row("ACTIVITY").ToString.Contains("DD")