473,394 Members | 1,726 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Help with WebForm

Ken
Hello,

I have a webform that gets a record from SQL Server by using a stored
procedure.
The stored procedure uses 3 parameters in which after the record is found,
stored procedure #2 runs to update one of the columns called Status from
"incomplete" to "Pending"
Status is one of the parameters for stored procedure #1.
This all works fine, My problem is after the person is finished with the
record they then push the next button to get the next record.
Prior to gettting the next record I need it to execute stored procedure #3
to update the Status column from "Pending" to "Complete"
What it is doing is its getting the next record and then running stored
procedure #3 which causes the new record to be updated instead of the
previous.

Any help would be greatly appreciated!
CODE:

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim cn As New ADODB.Connection
Dim Rs As ADODB.Recordset

cn.Open("Driver=SQL
Server;Server=xxxxx;Database=xxxxx;uid=xxxxx;pwd=x xxxx;")

Rs = New ADODB.Recordset
Rs.Open("Exec MyRecords" & "'" & Session("valType") & "'" & ", '" &
Session("valTC") & "'" & ", '" & Session("valLang") & "'", cn)
Session("valSerial") = Rs.Fields("Serial").Value

Dim RsPending As ADODB.Recordset
RsPending = New ADODB.Recordset
RsPending.Open("Exec StatusPending " & "'" & Session("valSerial") &
"'", cn, ADODB.CursorTypeEnum.adOpenKeyset,
ADODB.LockTypeEnum.adLockOptimistic)
lblSSN.Text = Rs.Fields("SSN").Value
lblBWE.Text = Rs.Fields("ProcDate").Value
lblDate.Text = Rs.Fields("ReceieveDate").Value
lblTime.Text = Rs.Fields("ProcessTime").Value
lblLang.Text = Rs.Fields("Language").Value
lblUser.Text = Rs.Fields("User").Value

End Sub
Private Sub btnNext_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles btnNext.Click
Dim objConn As SqlConnection = New SqlConnection("Data
Source=xxxxxxx;UID=xxxxx;PWD=xxxxx;")
Dim objStatusCompleteCMD As SqlCommand = New
SqlCommand("StatusComplete", objConn)
objStatusCompleteCMD.CommandType = CommandType.StoredProcedure

Dim PSerialNo As SqlParameter =
objStatusCompleteCMD.Parameters.Add("@Serial", SqlDbType.Char, 12)
PSerialNo.Value = Session("valSerial")

objConn.Open()

Dim myStatusC As SqlDataReader =
objStatusCompleteCMD.ExecuteReader()
myStatusC.Read()

myStatusC.Close()
myStatusC = Nothing

objConnStatus.Close()
objConnStatus = Nothing

End Sub
Nov 18 '05 #1
0 911

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Andy | last post by:
I have the following script to send my website form. The problem is when the form is submitted it sends a blank form Can anyone advise how i get the below to include the contents of all the...
1
by: cloverme | last post by:
Hi, I need help populating a listbox from a database on a webform. I created a an access database with a table, fields and data. Then I created a WebForm in vb.net and added a DropDownList...
3
by: trint | last post by:
Ok, I have tried to do this with the System.Web.UI and can't find anything for the webform. It seems much easier for a Winform. Any help in trapping Webform keydown event and keyup event is...
1
by: NH | last post by:
Hi, I'm struggling to display an image on asp.net webform (vb.net). The image is stored in a image field in a sql server database. I have read a good few solutions to it and still havnt got it...
3
by: Joe | last post by:
Hello All, I am developing a webform which creates ArrayLists of people's names and addresses (the values are retrieved from an xml file) and dynamically drops a user control onto the webform...
2
by: Richard | last post by:
I've been having alot of problems with asp.net 2.0's style sheet. When I apply a style sheet to a webform in the head tag (<link href="Site5.css" rel ="stylesheet" type ="text/css" runat="server"...
11
by: Brad Baker | last post by:
I'm building a small web application - I started out placing all my code in one file (config.aspx). As I continue to add code though it was becoming very unwieldy. After doing some searching...
1
by: almurph | last post by:
Hi everyone, I have an APS.NET (v1.1) type button on a webform page. What I want it to do is when the user clicks it, it then calls another webform page that appears in a pop-up window. Now I...
4
by: matpac4 | last post by:
I'm a bit stuck! Please can someone help. Here's what I'm trying to build: 1. Webform which puts variables into a database (each with unique ID field) 2. Webform also allows attachment which...
5
by: =?Utf-8?B?UGF1bA==?= | last post by:
Hi I have start web form and when the user clicks a button (server.transfer) they are directed to the second webform. I was wondering if there is a way to create an instance of the first webform...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.