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. How to fill form with blank fields in sql server using vb.net, i m new to .net

How to fill form with blank fields in sql server using vb.net, i m new to .net

Scheduled Pinned Locked Moved Web Development
databasehelpcsharphtml
3 Posts 3 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.
  • U Offline
    U Offline
    User 1875985
    wrote on last edited by
    #1

    Hi I am using html server controls with vb.net. I used sqlDataAdapter and Dataset to connect to tables. I am using sqlCommand to insert records in to database. If there is a better way to insert or update custom fields please tell me. Error: System.FormatException: Input string was not in a correct format Error Code: If Not Text4.Value.Empty Then SqlInsertCommand1.Parameters("@Date_Reg_RI").Value = Text4.Value Date_Reg_RI is a dateTime field in Database sql server2000 and i want to keep it blank. Any quick help is welcome. Regards Varun

    C S 2 Replies Last reply
    0
    • U User 1875985

      Hi I am using html server controls with vb.net. I used sqlDataAdapter and Dataset to connect to tables. I am using sqlCommand to insert records in to database. If there is a better way to insert or update custom fields please tell me. Error: System.FormatException: Input string was not in a correct format Error Code: If Not Text4.Value.Empty Then SqlInsertCommand1.Parameters("@Date_Reg_RI").Value = Text4.Value Date_Reg_RI is a dateTime field in Database sql server2000 and i want to keep it blank. Any quick help is welcome. Regards Varun

      C Offline
      C Offline
      Colin Angus Mackay
      wrote on last edited by
      #2

      VAcharya wrote: Text4.Value.Empty Are you sure about that? String.Empty[^] VAcharya wrote: Date_Reg_RI is a dateTime field in Database sql server2000 and i want to keep it blank If by "blank" you mean a null value then you should use System.DBNull.Value. I'm not sure this helps. Perhaps you could explain more.


      My: Blog | Photos | Next SQL Presentation WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More

      1 Reply Last reply
      0
      • U User 1875985

        Hi I am using html server controls with vb.net. I used sqlDataAdapter and Dataset to connect to tables. I am using sqlCommand to insert records in to database. If there is a better way to insert or update custom fields please tell me. Error: System.FormatException: Input string was not in a correct format Error Code: If Not Text4.Value.Empty Then SqlInsertCommand1.Parameters("@Date_Reg_RI").Value = Text4.Value Date_Reg_RI is a dateTime field in Database sql server2000 and i want to keep it blank. Any quick help is welcome. Regards Varun

        S Offline
        S Offline
        sstocker
        wrote on last edited by
        #3

        Datetime doesn't except null values (that is usually how it is set up), so if you want to insert a blank value I believe you can just insert "' '". Let me know if it works. Scott Stocker

        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