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. General Programming
  3. Visual Studio
  4. how to insert all characters in database from textbox

how to insert all characters in database from textbox

Scheduled Pinned Locked Moved Visual Studio
csharpdatabasetutorialquestion
2 Posts 2 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.
  • B Offline
    B Offline
    Beiniam
    wrote on last edited by
    #1

    hello guys i have doing some project and since i have new for vb.net 2010. my project is coded in vb.net 2010 and ms access 2007 mdb database. i have DocId, description, date and other fileds in the table.. my querry works for all but. i can't add all characters except integers in the database column DocId. it accepts only integer values. so how can i insert characters in the DocId filed. here is the detail the DocId filed property is Text field tables: DocId======Textbox name RefferencNoTxt.Text Table name = EraDms database name= data

    cmd.CommandText = "INSERT INTO EraDms(DocId,Description,Address,NoOfPages, SendOrReceived, SentDate,ReceivedDate,ForwardedWorkingUnit,Attachements,ForwardedDate,ReceivedBy,DocPath) " & _
    " VALUES(" & Me.RefferencNoTxt.Text.ToString & ",'" & Me.DescriptionTextBox.Text & "','" & Me.AddressTextBox.Text & "','" & Me.NoOfPagesTextBox.Text & "','" & Me.SendOrReceievedComboBox.Text & "','" & _
    Me.SentDateTextBox.Text & "','" & Me.receivedDate.Text & "','" & Me.ForwardedWorkingUnitTextBox.Text & "','" & Me.AttachementsTextBox.Text & "','" & Me.TextBox6.Text & "','" & Me.ReceivedByTextBox.Text & "','" & Me.DocPathTextBox.Text & "')"
    cmd.ExecuteNonQuery()
    MessageBox.Show("File Upload Successfull", "ERA-DMS-File Uploader", MessageBoxButtons.OK, MessageBoxIcon.Information)
    RefreshData()

           '  With ERA\_DMS\_HOME
    
           ' End With
           cnn.Close()
       Else
           'update data in table
           cmd.CommandText = "UPDATE Eradms " & \_
                       " SET DocId=" & Me.RefferencNoTxt.Text.ToString & \_
                       ", Description='" & Me.DescriptionTextBox.Text & "'" & \_
                       ", Address='" & Me.AddressTextBox.Text & "'" & \_
                       ", NoOfPages='" & Me.NoOfPagesTextBox.Text & "'" & \_
                       ", SendOrReceived='" & Me.SendOrReceievedComboBox.Text & &quo
    
    Richard DeemingR 1 Reply Last reply
    0
    • B Beiniam

      hello guys i have doing some project and since i have new for vb.net 2010. my project is coded in vb.net 2010 and ms access 2007 mdb database. i have DocId, description, date and other fileds in the table.. my querry works for all but. i can't add all characters except integers in the database column DocId. it accepts only integer values. so how can i insert characters in the DocId filed. here is the detail the DocId filed property is Text field tables: DocId======Textbox name RefferencNoTxt.Text Table name = EraDms database name= data

      cmd.CommandText = "INSERT INTO EraDms(DocId,Description,Address,NoOfPages, SendOrReceived, SentDate,ReceivedDate,ForwardedWorkingUnit,Attachements,ForwardedDate,ReceivedBy,DocPath) " & _
      " VALUES(" & Me.RefferencNoTxt.Text.ToString & ",'" & Me.DescriptionTextBox.Text & "','" & Me.AddressTextBox.Text & "','" & Me.NoOfPagesTextBox.Text & "','" & Me.SendOrReceievedComboBox.Text & "','" & _
      Me.SentDateTextBox.Text & "','" & Me.receivedDate.Text & "','" & Me.ForwardedWorkingUnitTextBox.Text & "','" & Me.AttachementsTextBox.Text & "','" & Me.TextBox6.Text & "','" & Me.ReceivedByTextBox.Text & "','" & Me.DocPathTextBox.Text & "')"
      cmd.ExecuteNonQuery()
      MessageBox.Show("File Upload Successfull", "ERA-DMS-File Uploader", MessageBoxButtons.OK, MessageBoxIcon.Information)
      RefreshData()

             '  With ERA\_DMS\_HOME
      
             ' End With
             cnn.Close()
         Else
             'update data in table
             cmd.CommandText = "UPDATE Eradms " & \_
                         " SET DocId=" & Me.RefferencNoTxt.Text.ToString & \_
                         ", Description='" & Me.DescriptionTextBox.Text & "'" & \_
                         ", Address='" & Me.AddressTextBox.Text & "'" & \_
                         ", NoOfPages='" & Me.NoOfPagesTextBox.Text & "'" & \_
                         ", SendOrReceived='" & Me.SendOrReceievedComboBox.Text & &quo
      
      Richard DeemingR Offline
      Richard DeemingR Offline
      Richard Deeming
      wrote on last edited by
      #2

      You've already posted this question in the Visual Basic forum[^]. Don't post the same question in multiple forums.


      "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

      "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

      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