| | |
textbox multiline Access VB
Please support our ASP.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Oct 2009
Posts: 1
Reputation:
Solved Threads: 0
I am having trouble with textbox multiline when it store to Access database and returning in gridview show one chunk of string. Is there anyway to place each data into each own row?
Input:
google
yahoo
msn
Output:
www.google.com
www.yahoo.com
www.msn.com
But right now it is give me www.googleyahoomsn.com
Here is my code:
Input:
yahoo
msn
Output:
www.google.com
www.yahoo.com
www.msn.com
But right now it is give me www.googleyahoomsn.com
Here is my code:
asp.net Syntax (Toggle Plain Text)
Sub btnSubmitClicked(ByVal S As Object, ByVal e As EventArgs) Dim conn1 As New OleDbConnection("Provider=Microsoft.jet.oledb.4.0;Data Source=C:\Data\audit.mdb") Dim strInsert As String Dim strDelete As String Dim cmdInsert As OleDbCommand Dim cmdDelete As OleDbCommand TextBox1.TextMode = TextBoxMode.MultiLine TextBox1.MaxLength = 15 strInsert = "Insert into audit(fldLocation) values ('" & TextBox1.Text & "')" strDelete = "DELETE * FROM audit " cmdInsert = New OleDbCommand(strInsert, conn1) cmdDelete = New OleDbCommand(strDelete, conn1) conn1.Open() cmdDelete.ExecuteNonQuery() cmdInsert.ExecuteReader() conn1.Close() Response.Redirect("audit.aspx") End Sub End Class
Last edited by peter_budo; Oct 13th, 2009 at 2:20 pm. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks)
•
•
Join Date: Sep 2007
Posts: 66
Reputation:
Solved Threads: 12
0
#2 Oct 13th, 2009
•
•
•
•
I am having trouble with textbox multiline when it store to Access database and returning in gridview show one chunk of string. Is there anyway to place each data into each own row?
Input:
yahoo
msn
Output:
www.google.com
www.yahoo.com
www.msn.com
But right now it is give me www.googleyahoomsn.com
Here is my code:
Sub btnSubmitClicked(ByVal S As Object, ByVal e As EventArgs)
Dim conn1 As New OleDbConnection("Provider=Microsoft.jet.oledb.4.0;Data Source=C:\Data\audit.mdb")
Dim strInsert As String
Dim strDelete As String
Dim cmdInsert As OleDbCommand
Dim cmdDelete As OleDbCommand
TextBox1.TextMode = TextBoxMode.MultiLine
TextBox1.MaxLength = 15
strInsert = "Insert into audit(fldLocation) values ('" & TextBox1.Text & "')"
strDelete = "DELETE * FROM audit "
cmdInsert = New OleDbCommand(strInsert, conn1)
cmdDelete = New OleDbCommand(strDelete, conn1)
conn1.Open()
cmdDelete.ExecuteNonQuery()
cmdInsert.ExecuteReader()
conn1.Close()
Response.Redirect("audit.aspx")
End Sub
End Class
I assume that you have " " single blanck space as separator in ur input. pls. follow the code below...
ASP.NET Syntax (Toggle Plain Text)
Private Function DoStuff() As String Dim arr As Array Dim str As String = "yahoo google gmail" 'i assume your input with singe space Dim strResult As String arr = str.Split(" ") For i As Integer = 0 To UBound(arr) strResult += "www." & arr(i) & ".com" & ", " Next Return strResult End Function 'use it dostuff function in your query strInsert = "Insert into audit(fldLocation) values ('" & DoStuff.ToString & "')"
Pls. mark as solved if it helps you!!!
Last edited by reach_yousuf; Oct 13th, 2009 at 4:25 am.
![]() |
Similar Threads
- Fill Textbox w/ DataReader from Access and allowing user's to update (ASP.NET)
- how to update an access database using a textbox in vb (Visual Basic 4 / 5 / 6)
- textbox value check with Access (C#)
- MultiLine TextBoxes in GridView edit mode (ASP.NET)
- remove unwanted character from textbox (C#)
- SQL Data into Textbox or Listbox (C#)
- Wrapping a text in Textbox (C#)
- How to Control the Length of a multiline text box (ASP.NET)
Other Threads in the ASP.NET Forum
- Previous Thread: Onclick event method only works once.
- Next Thread: Need help for Regular Expression
| Thread Tools | Search this Thread |
.net activexcontrol advice ajax alltypeofvideos appliances asp asp.net bc30451 beginner bottomasp.net box browser button c# cac checkbox click commonfunctions control css dataaccesslayer database datagridview datagridviewcheckbox datalist deadlock deployment development dgv dialog dropdownlist dynamic dynamically edit embeddingactivexcontrol expose fileuploader fill findcontrol flash formatdecimal formview gridview gudi iframe iis javascript listbox login microsoft mono mouse mssql multistepregistration news novell numerical objects opera panelmasterpagebuttoncontrols radio redirect registration relationaldatabases reportemail rotatepage save schoolproject search security sessionvariables silverlight smartcard smoobjects software sql-server sqlserver2005 ssl suse textbox tracking treeview unauthorized validatedate validation vb.net video videos virtualdirectory vista visualstudio web webapplications webdevelopemnt webdevelopment webprogramming webservice xsl youareanotmemberofthedebuggerusers





