Visual Studio Web Page

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

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:
 

Attachments

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

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 807,865 other people just like you!

Latest posts

Staff online

Members online

Top