Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
D

David McGraw

@David McGraw
About
Posts
3
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • change image every day c# Linq
    D David McGraw

    Good one Richard.

    LINQ csharp linq question

  • How to query a Dataset using LINQ?
    D David McGraw

    To avoid null values in your linq result, then you need to write the query like as shown below.

                    var q = from a1 in dt\_Jobs.AsEnumerable()
                    where !string.IsNullOrEmpty(a1.Field("City"))
                    orderby a1.Field("City")
                    select a1.Field("City");
                    var lstCity = q.Distinct().ToList();
                    cboCity.DataSource = lstCity;
    

    To know how to use linq with dataset, check following article it will help you. LINQ to Dataset with Example[^]

    LINQ csharp css database linq tutorial

  • Not understanding use of return statement in c#.
    D David McGraw

    Hi Hassan, You are getting result 100 because your function abc(ref int i) is accepting ref type parameter. Generally, the ref keyword is used to pass parameter as a reference this means when the value of parameter is changed in called method, then that will get reflected in calling method also. Whenever the following function executed, the result of value of j will be assigned to your parameter i.

    public static int abc(ref int j)
    {
    j = 100;
    return j;
    }

    That's the reason you are getting i values as 100 even after you change return statement as "return 0". If you want to know more about return statement and ref keyword check following topics it will help you understand how & when to use these keywords clearly in c#. Ref Keyword in C#[^] Return Statement in C#[^]

    C# question csharp learning
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups