473,385 Members | 1,409 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,385 software developers and data experts.

updating data in the backend

44
Hi

In my home page I have the login form & the link button named "Update Profile?". If I click that link button, then it redirects to the page which has the Profile Updation Process which includes all the profile details that the user registered during registration and the user can update the existing profile here. For that, in the profile updation page, I have given the coding as

Imports System.Data
Imports System.Data.SqlClient
Partial Class Default2
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
Dim con As SqlConnection
Dim cmd As SqlCommand
Dim str, str1 As String
str = "user id=sa;password=cast;database=jsc;server=AURORA-SERVER"
con = New SqlConnection(str)
Try
con.Open()
Catch
End Try
str1 = "select * from login"
cmd = New SqlCommand(str1, con)
Dim dr1 As SqlDataReader
dr1 = cmd.ExecuteReader()
While dr1.Read()
txtLoginId2.Text = dr1.GetValue(0)
txtPassword1.Text = dr1.GetValue(1)
txtConfirmPassword.Text = dr1.GetValue(2)
txtFirstName.Text = dr1.GetValue(3)
txtLastName.Text = dr1.GetValue(4)
txtAddress.Text = dr1.GetValue(5)
txtAddress2.Text = dr1.GetValue(6)
txtAddress3.Text = dr1.GetValue(7)
txtCity.Text = dr1.GetValue(8)
txtCountry.Text = dr1.GetValue(9)
txtProvince.Text = dr1.GetValue(10)
txtPostalCode.Text = dr1.GetValue(11)
txtPhone.Text = dr1.GetValue(12)
txtEmail1.Text = dr1.GetValue(13)
txtHow.Text = dr1.GetValue(14)
End While
con.Close()
End If
End Sub



Protected Sub btnUpdateProfile_Click1(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnRegister.Click
Dim con As SqlConnection
Dim cmd As SqlCommand
Dim str, str1 As String
str = "user id=sa;password=cast;database=jsc;server=AURORA-SERVER"
con = New SqlConnection(str)
Try
con.Open()
Catch
End Try
str1 = "update login set loginid='" & txtLoginId2.Text & "', password='" & txtPassword1.Text & "',confirmpassword='" & txtConfirmPassword.Text & "',firstname='" & txtFirstName.Text & "',lastname='" & txtLastName.Text & "',address='" & txtAddress.Text & "',address2='" & txtAddress2.Text & "',address3='" & txtAddress3.Text & "',city='" & txtCity.Text & "',country='" & txtCountry.Text & "',province='" & txtProvince.Text & "',postalcode=" & txtPostalCode.Text & ",phone='" & txtPhone.Text & "',email='" & txtEmail1.Text & "',how='" & txtHow.Text & "'"
cmd = New SqlCommand(str1, con)
cmd.ExecuteNonQuery()
con.Close()
Response.Redirect("Default3.aspx")
End Sub
End Class

But if I give the above coding, only the last record is getting displayed on the textbox. The thing is the profile should get displayed on the textboxes according to the loginid and password that the user has entered on the login page.
May 13 '08 #1
2 1153
debasisdas
8,127 Expert 4TB
is the profile getting updated ?
May 13 '08 #2
sweatha
44
is the profile getting updated ?
Its getting updated. But the profile should get displayed on the textboxes according to the loginid and password that the user entered.
May 13 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: foobar | last post by:
Okay, I have created a Customers class. This class allows a user to select and update the customers table on an Sql Server database. I can retrieve the datatable generated by the class. Make...
2
by: Eric G | last post by:
Hello, I'm using A2K and would like to update our school back-end server file. I've taken a copy of it home because I was having some trouble updating it at school. I basically want to add...
1
by: derek | last post by:
Hello, I have been trying for a while but have been unable to do this: I have two drop down lists and a submit button. After choosing appropriate values in the dropdowwnlists, I hit the submit...
1
by: robert d via AccessMonster.com | last post by:
My application is beginning to interest prospective clients. This may be wishful thinking, but if I have a lot of clients how will I update a production backend when I need to add tables (for...
4
by: Mark | last post by:
Hi All, I created a database for a friend a few months ago which has been working fine. However, he now wants a few changes implemented to accommodate his growing needs. When I gave him the...
1
by: rdemyan via AccessMonster.com | last post by:
My App has 10 or so tables that we provide that contains proprietary data. This data will need to be updated once or twice a year. I would like some comments, suggestions on my proposed strategy...
9
by: paul | last post by:
Hi All, We have a small dilemma. We have the following page: http://giggsey.com/m00Cow.php (don't ask about the content) that we want to turn into an interactive application for some new intake...
5
by: aaron.m.johnson | last post by:
I have an application which contains an Access database with linked tables that point to another database within the application. The problem I have is that when the user installs the application,...
4
by: rdemyan via AccessMonster.com | last post by:
My application is calculation intensive and the servers are agonizingly slow. Administrators of my application only update the backends once a month (twice a month max). So, my launching program...
3
by: amollokhande1 | last post by:
Hi All, I am using Sql server 2005 as a backend for my application. I want to read/write the unicode data using sql query. When I am using insert into UnicodeData values('سي') command and...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.