Help with using a Text input control as a datasource

Hello,

I need to use a control that I can enter data in multiple lines and at the same time can connect to a datasource, a regular textbox is perfect for entering data but it doesn't have a datsource property, Do you have an alternate solution?

I looked at the DropdownList but I am unable to enter text, can't seem to find any other controls in my toolbox.

victor
vcharlesAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

GlobaLevelProgrammerCommented:
1)textbox can be connected to a data source..use smart tag in design mode
2) you can user web user controls or a web part
3) see atcched this will get you going
public sub button1_onclick(sender as s, eventargs as e) handles button1.click
' ------------------
' SQL INSERT PARAMTERS
' ----------------

'VB SQL INSERT



Dim SQLConn1 As SqlConnection = New SqlConnection()
        Dim cmd1 As SqlCommand
        Dim SQLStr1 As String
        Dim Err1 As String

        Dim session_id As String
        Dim rep_name As String
        Dim client_status As String
        Dim Rep_Response As String
        Dim client_response As String
        Dim CLIENT_FDBK_GD_JB As String
        Dim CLIENT_FDBK_IMPROVE As String

session_id = textbox1.text

        session_id = Session("Session_ID")
        rep_name = Session("Call_Center_Rep")
        client_status = ""
        Rep_Response = Session("Rep_Response")
        client_response = Session("client_Response")
        CLIENT_FDBK_GD_JB = TextBox2.Text
        CLIENT_FDBK_IMPROVE = TextBox3.Text

        SQLConn1.ConnectionString = "Network Library=DBMSSOCN; Data Source=xx.xx.xx.xx; Initial Catalog=dasdsf; Trusted_Connection=true;User ID=; Password="

        SQLStr1 = ("INSERT INTO Live_Chat_Client_Feedback (SESSION_ID, REP_NAME, CLIENT_STATUS," & _
                   "REP_RESPONSE, CLIENT_RESPONSE, CLIENT_FDBK_GD_JB, CLIENT_FDBK_IMPROVE) VALUES " & _
                   "(@SESSION_ID, @REP_NAME, @CLIENT_STATUS, @REP_RESPONSE, @CLIENT_RESPONSE, @CLIENT_FDBK_GD_JB,@CLIENT_FDBK_IMPROVE)")

        SQLConn1.Open()
        cmd1 = New SqlCommand(SQLStr1, SQLConn1)
        cmd1.Parameters.AddWithValue("@SESSION_ID", session_id)
        cmd1.Parameters.AddWithValue("@REP_NAME", rep_name)
        cmd1.Parameters.AddWithValue("@CLIENT_STATUS", client_status)
        cmd1.Parameters.AddWithValue("@REP_RESPONSE", Rep_Response)
        cmd1.Parameters.AddWithValue("@CLIENT_RESPONSE", client_response)
        cmd1.Parameters.AddWithValue("@CLIENT_FDBK_GD_JB", CLIENT_FDBK_GD_JB)
        cmd1.Parameters.AddWithValue("@CLIENT_FDBK_IMPROVE", CLIENT_FDBK_IMPROVE)

        Try
            Err1 = cmd1.ExecuteNonQuery()
        Finally
            SQLConn1.Close()
        End Try

end sub

----
html

<asp:button id="button1" onclick="button1_onlick" runat=server" />

Open in new window

0
vcharlesAuthor Commented:
Hi,

I am using xml, below is an example of my code below, i would like C1countryUser/Origin to be textboxes
to allow users to enter data and save changes.


' create a new XML Document object for each XML file
        Dim xdDonor As New Xml.XmlDocument
        Dim xdLink As New Xml.XmlDocument
        Dim xdReceiver As New Xml.XmlDocument

        ' load all of the XML documents
        xdDonor.Load(Server.MapPath("~/App_Data/CountryOrigin.xml"))
        xdLink.Load(Server.MapPath("~/App_Data/LinkSSADB.xml"))
        xdReceiver.Load(Server.MapPath("~/App_Data/CountryUser.xml"))

        ' Extract the ReceiverID and DonorID values from the current node
        Dim ReceiverID As String
        Dim DonorID As String
        Dim Link_ID As String
        '   Dim LinkID2 As String
        Dim DonorID2 As String
        Dim Name As String
        Dim ReceiverID2 As String

        dtReceiver = New DataTable
        dtReceiver.Columns.Add("ReceiverID", GetType(String))
        dtReceiver.Columns.Add("Name", GetType(String))
        dtDonor = New DataTable
        dtDonor.Columns.Add("DonorID", GetType(String))
        dtDonor.Columns.Add("Name", GetType(String))

        Session("CurrentIndex") = 0
        Session("dtDonor") = dtDonor
        Session("dtReceiver") = dtReceiver
        MsgBox(C1Fuze.SelectedItem.Value)

        ' This outer loop will iterate over the Link file where the ReceiverID node is equal to our search criteria
        For Each xnLink As Xml.XmlNode In xdLink.SelectNodes("/Root/LinkA[manufacturer_ID='" & C1Manufacturer.SelectedItem.Value & "']")
            Link_ID = xnLink.SelectSingleNode("LinkAID").InnerText
            ReceiverID = xnLink.SelectSingleNode("CountryUser_ID").InnerText
            DonorID = xnLink.SelectSingleNode("CountryOrigin_ID").InnerText

            ' Perform another similar search based upon the Donor XML file
            For Each xnDonor As Xml.XmlNode In xdDonor.SelectNodes("/Root/CountryOriginTable[CountryOrigin_ID='" & DonorID & "']")
                DonorID2 = xnDonor.SelectSingleNode("CountryOrigin_ID").InnerText
                Name = xnDonor.SelectSingleNode("CountryOrigin").InnerText
                dtDonor.Rows.Add({DonorID2, Name})
               
            Next

           
            ' Perform yet another practically identical search on the Receiver XML file
            For Each xnReceiver As Xml.XmlNode In xdReceiver.SelectNodes("/Root/CountryUserTable[CountryUser_ID='" & ReceiverID & "']")
                '' Extract the ReceiverID and Name values from the current node
                ReceiverID2 = xnReceiver.SelectSingleNode("CountryUser_ID").InnerText
                Name = xnReceiver.SelectSingleNode("CountryUser").InnerText
                dtReceiver.Rows.Add({ReceiverID2, Name})
            Next
            ' Extract the Link_ID avalues from the current node
            '  dtLinkID = New DataTable
            ' dtLinkID.Columns.Add("Link_ID", GetType(String))
            'LinkID2 = xnLink.SelectSingleNode("LinkAID").InnerText
            'dtLinkID.Rows.Add({LinkID2})
        Next

        C1CountryOrigin.DataSource = dtDonor
        C1CountryOrigin.DataTextField = "Name"
        C1CountryOrigin.DataValueField = "DonorID"
        C1CountryOrigin.DataBind()

        C1CountryUser.DataSource = dtReceiver
        C1CountryUser.DataTextField = "Name"
        C1CountryUser.DataValueField = "ReceiverID"
        C1CountryUser.DataBind()
0
CodeCruiserCommented:
As suggested in below question, you can do the reverse. Let the user type a value in a textbox and then

dtDonor.Rows(rowindex).Item("columname") = textbox1.text

http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/Q_27497150.html#a37303704
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
vcharlesAuthor Commented:
Thank You.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.