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. C# to Vb.net Convert error in string place...,

C# to Vb.net Convert error in string place...,

Scheduled Pinned Locked Moved ASP.NET
csharphelpquestion
6 Posts 5 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.
  • M Offline
    M Offline
    Member 3879881
    wrote on last edited by
    #1

    Hi i convert some c# code to vb.net format, But i am getting error in one place..., Plz see this code: This is C# code: String addData = "INSERT INTO Ords (OrderId, CustomerId, ShipName, ShipCity) VALUES ('" + Guid.NewGuid() + "','" + new Guid(e.CommandArgument.ToString()) + "','" + txtAddShipName.Text.Trim() + "','" + txtAddShipCity.Text.Trim() + "')"; After convert to Vb.net format: Dim addData As String = ("INSERT INTO Ords (OrderId, CustomerId, ShipName, ShipCity) VALUES ('" _ + (Guid.NewGuid) + "','" _ + (New Guid(e.CommandArgument.ToString)) + "','" _ + (txtAddShipName.Text.Trim) + "','" _ + (txtAddShipCity.Text.Trim) + "')") Whats the probs in thsi code?, I have mentioned wher i get probs that is in bold letters...,

    Regards, Magi

    C M N 3 Replies Last reply
    0
    • M Member 3879881

      Hi i convert some c# code to vb.net format, But i am getting error in one place..., Plz see this code: This is C# code: String addData = "INSERT INTO Ords (OrderId, CustomerId, ShipName, ShipCity) VALUES ('" + Guid.NewGuid() + "','" + new Guid(e.CommandArgument.ToString()) + "','" + txtAddShipName.Text.Trim() + "','" + txtAddShipCity.Text.Trim() + "')"; After convert to Vb.net format: Dim addData As String = ("INSERT INTO Ords (OrderId, CustomerId, ShipName, ShipCity) VALUES ('" _ + (Guid.NewGuid) + "','" _ + (New Guid(e.CommandArgument.ToString)) + "','" _ + (txtAddShipName.Text.Trim) + "','" _ + (txtAddShipCity.Text.Trim) + "')") Whats the probs in thsi code?, I have mentioned wher i get probs that is in bold letters...,

      Regards, Magi

      C Offline
      C Offline
      cometburn007
      wrote on last edited by
      #2

      try this: Dim addData As String = "INSERT INTO Ords (OrderId, CustomerId, ShipName, ShipCity) VALUES " & _ "('" & (Guid.NewGuid) & "'," & _ " '"& (New Guid(e.CommandArgument.ToString)) & "'," & _ " '" & (txtAddShipName.Text.Trim) & "', " & _ " '" & (txtAddShipCity.Text.Trim) & "')"

      M 1 Reply Last reply
      0
      • C cometburn007

        try this: Dim addData As String = "INSERT INTO Ords (OrderId, CustomerId, ShipName, ShipCity) VALUES " & _ "('" & (Guid.NewGuid) & "'," & _ " '"& (New Guid(e.CommandArgument.ToString)) & "'," & _ " '" & (txtAddShipName.Text.Trim) & "', " & _ " '" & (txtAddShipCity.Text.Trim) & "')"

        M Offline
        M Offline
        Member 3879881
        wrote on last edited by
        #3

        No its giving same place error...,

        Regards, Magi

        K 1 Reply Last reply
        0
        • M Member 3879881

          No its giving same place error...,

          Regards, Magi

          K Offline
          K Offline
          koolprasad2003
          wrote on last edited by
          #4

          hey, try it, Private addData As String = "INSERT INTO Ords (OrderId, CustomerId, ShipName, ShipCity) VALUES ('" + Guid.NewGuid regards, koolprasad2003

          If the message is useful for U then please Rate This message... Be a good listener...Because Opprtunity knoughts softly...N-Joy

          1 Reply Last reply
          0
          • M Member 3879881

            Hi i convert some c# code to vb.net format, But i am getting error in one place..., Plz see this code: This is C# code: String addData = "INSERT INTO Ords (OrderId, CustomerId, ShipName, ShipCity) VALUES ('" + Guid.NewGuid() + "','" + new Guid(e.CommandArgument.ToString()) + "','" + txtAddShipName.Text.Trim() + "','" + txtAddShipCity.Text.Trim() + "')"; After convert to Vb.net format: Dim addData As String = ("INSERT INTO Ords (OrderId, CustomerId, ShipName, ShipCity) VALUES ('" _ + (Guid.NewGuid) + "','" _ + (New Guid(e.CommandArgument.ToString)) + "','" _ + (txtAddShipName.Text.Trim) + "','" _ + (txtAddShipCity.Text.Trim) + "')") Whats the probs in thsi code?, I have mentioned wher i get probs that is in bold letters...,

            Regards, Magi

            M Offline
            M Offline
            Michael Sync
            wrote on last edited by
            #5

            The Converter gives me this ~ Dim addData As String = "INSERT INTO Ords (OrderId, CustomerId, ShipName, ShipCity) VALUES ('" & Guid.NewGuid() & "','" & New Guid(e.CommandArgument.ToString()) & "','" * txtAddShipName.Text.Trim() & "','" & txtAddShipCity.Text.Trim() & "')" What error you are getting? at runtime or design time? Show us the error message.

            Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net) If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you. :)

            1 Reply Last reply
            0
            • M Member 3879881

              Hi i convert some c# code to vb.net format, But i am getting error in one place..., Plz see this code: This is C# code: String addData = "INSERT INTO Ords (OrderId, CustomerId, ShipName, ShipCity) VALUES ('" + Guid.NewGuid() + "','" + new Guid(e.CommandArgument.ToString()) + "','" + txtAddShipName.Text.Trim() + "','" + txtAddShipCity.Text.Trim() + "')"; After convert to Vb.net format: Dim addData As String = ("INSERT INTO Ords (OrderId, CustomerId, ShipName, ShipCity) VALUES ('" _ + (Guid.NewGuid) + "','" _ + (New Guid(e.CommandArgument.ToString)) + "','" _ + (txtAddShipName.Text.Trim) + "','" _ + (txtAddShipCity.Text.Trim) + "')") Whats the probs in thsi code?, I have mentioned wher i get probs that is in bold letters...,

              Regards, Magi

              N Offline
              N Offline
              Nouman Bhatti
              wrote on last edited by
              #6

              there's a ( before the "

              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