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
  1. Home
  2. Web Development
  3. ASP.NET
  4. What is operator used in ASP.NET2.0 instead od "& _"

What is operator used in ASP.NET2.0 instead od "& _"

Scheduled Pinned Locked Moved ASP.NET
csharphelpquestionasp-net
8 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Y Offline
    Y Offline
    YazhiniP
    wrote on last edited by
    #1

    Hi, I am working with Visual Web Developer 2005(c#.net). I want to pass more than 15 parameters to a function. So,for clarity i wrote the function in multiple line using the operator "& _". But,it doesn't work and i get an error message as 'The name '_' doesn't exist in the current context. Can anybody help me in this?.

    L B 2 Replies Last reply
    0
    • Y YazhiniP

      Hi, I am working with Visual Web Developer 2005(c#.net). I want to pass more than 15 parameters to a function. So,for clarity i wrote the function in multiple line using the operator "& _". But,it doesn't work and i get an error message as 'The name '_' doesn't exist in the current context. Can anybody help me in this?.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      '& _' can be used only with VB.NET. Use '+' to concatenate strings in C#

      1 Reply Last reply
      0
      • Y YazhiniP

        Hi, I am working with Visual Web Developer 2005(c#.net). I want to pass more than 15 parameters to a function. So,for clarity i wrote the function in multiple line using the operator "& _". But,it doesn't work and i get an error message as 'The name '_' doesn't exist in the current context. Can anybody help me in this?.

        B Offline
        B Offline
        Baran M
        wrote on last edited by
        #3

        in vb.net there is no End of the line character ";" so if you want to break a single line into 2 you have to use "-". In C# we have ";", so we can split a line into 2. Ex: Response.Write ( "Hi, Like this" ); :)

        P Y 2 Replies Last reply
        0
        • B Baran M

          in vb.net there is no End of the line character ";" so if you want to break a single line into 2 you have to use "-". In C# we have ";", so we can split a line into 2. Ex: Response.Write ( "Hi, Like this" ); :)

          P Offline
          P Offline
          padmanabhan N
          wrote on last edited by
          #4

          //you can use like this also Response.Write("hi,"+path+"");

          Padmanabhan

          1 Reply Last reply
          0
          • B Baran M

            in vb.net there is no End of the line character ";" so if you want to break a single line into 2 you have to use "-". In C# we have ";", so we can split a line into 2. Ex: Response.Write ( "Hi, Like this" ); :)

            Y Offline
            Y Offline
            YazhiniP
            wrote on last edited by
            #5

            objIncidentBL.UpdateIncidentDetails(Convert.ToInt32(txtIncidentNo.ToString()),                                                       txtApplicationName.ToString(),                                                       txtIncidentType.ToString()); I have to pass 15 more parameters in this function.if i use '+' as below,i m getting an error message such as operator '+' cannot be applied to operand of type string. objIncidentBL.UpdateIncidentDetails(Convert.ToInt32(txtIncidentNo.ToString()), +                                                       txtApplicationName.ToString(), +                                                       txtIncidentType.ToString());

            Yazhini

            B 1 Reply Last reply
            0
            • Y YazhiniP

              objIncidentBL.UpdateIncidentDetails(Convert.ToInt32(txtIncidentNo.ToString()),                                                       txtApplicationName.ToString(),                                                       txtIncidentType.ToString()); I have to pass 15 more parameters in this function.if i use '+' as below,i m getting an error message such as operator '+' cannot be applied to operand of type string. objIncidentBL.UpdateIncidentDetails(Convert.ToInt32(txtIncidentNo.ToString()), +                                                       txtApplicationName.ToString(), +                                                       txtIncidentType.ToString());

              Yazhini

              B Offline
              B Offline
              Baran M
              wrote on last edited by
              #6

              LazhiniP is true.Remove "+" it will work fine.:)

              Y B 2 Replies Last reply
              0
              • B Baran M

                LazhiniP is true.Remove "+" it will work fine.:)

                Y Offline
                Y Offline
                YazhiniP
                wrote on last edited by
                #7

                No...if i remove '+' it gets compiled but i m throws a run-time error stating "input string is not in correct format". Whether '+' operator doesn't work for parameter passing or in function definition?

                Yazhini

                1 Reply Last reply
                0
                • B Baran M

                  LazhiniP is true.Remove "+" it will work fine.:)

                  B Offline
                  B Offline
                  Baran M
                  wrote on last edited by
                  #8

                  if you think the problem is with "+" Response.Write("First" + "Second" + "Third" ); Try this :)

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

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