1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Visual Studio Web Page

Discussion in 'Software Development' started by jrockusa, Apr 6, 2010.

Thread Status:
Not open for further replies.
  1. jrockusa

    jrockusa Thread Starter

    Joined:
    Apr 5, 2010
    Messages:
    1
    Hello,

    I am new to visual studio and need some help. I am creating a form webpage using this program and I have a question about how to manipulate the fields on the form. I have used the below code to connect to various tables on SQL. When opening the form in my browser it works fine. I can enter data in each field. The problem is that with certain fields I want them to be dropdown boxes. For example, with the Management Code field (below) I want this to be a dropdown box. The information I need for the dropdown box comes from the Fund Number table (Group) column. See the 2nd screen shot on the document I attached.

    How would I change the below code to change this particular field (Management Code) to a dropdown box? I have has used the dropdown list under toolbox but I can't get it to work so it will link to another form I created to review all submitted requests.

    Please keep in mind that the information entered in this field must also show up on other view forms I created.

    Any help you could provide would be greatly appreciated. Thanks


    HTML:
    
    
    Partial
    Class EnterRequest
    Inherits System.Web.UI.Page
    Dim dbconn As New ADODB.Connection
    Dim strconn As String
    Dim rs As New ADODB.Recordset

    Protected Sub cmdGo_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdGo.Click
    Dim tmpreqid As Double

    strconn = "Provider=SQLOLEDB.1;Data Source=SVAOR14P501M6D;Initial Catalog=TAMain;Persist Security Info=True;Trusted_Connection=False;User ID=TAUser;Password=tauser2010"
    dbconn.Open(strconn)
    rs.Open("Select [Request ID] from Requests order by [Request ID] desc", dbconn, ADODB.CursorTypeEnum.adOpenDynamic, ADODB.LockTypeEnum.adLockOptimistic)
    rs.MoveFirst()
    tmpreqid = rs.Fields("Request ID").Value + 1
    rs.Close()

    rs.Open("Select * from Requests ", dbconn, ADODB.CursorTypeEnum.adOpenDynamic, ADODB.LockTypeEnum.adLockOptimistic)

    rs.AddNew()

    rs.Fields("Request ID").Value = tmpreqid
    rs.Fields("Request Title").Value = txtReqTitle.Text
    rs.Fields("Sub Type").Value = txtRequestType.Text
    rs.Fields("Requested Completetion Date").Value = txtReqCompletedate.Text
    rs.Fields("Requestor").Value = txtRequestor.Text
    rs.Fields("Management Code").Value = txtMgmtCo.Text
    rs.Fields("Type").Value = txtBusArea.Text
    rs.Fields("SS personal").Value = txtSSContact.Text
    rs.Fields("Priorty").Value = txtPriority.Text
    rs.Fields("Fund No").Value = txtFundCode.Text
    rs.Fields("Business Reason").Value = txtBusReason.Text
    rs.Fields("Request Description").Value = txtReqDesc.Text
    rs.Fields("Request Updates and Resolution").Value = txtReqUpdates.Text
    rs.Update()

    rs.Close()
    rs = Nothing

    dbconn.Close()
    dbconn = Nothing

    End Sub
    End
    Class
    HTML:
    
    
     

    Attached Files:

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Similar Threads - Visual Studio Page
  1. Bqwaszx
    Replies:
    1
    Views:
    419
  2. stevezal
    Replies:
    0
    Views:
    517
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/915173

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice