kodingkarthik 0 Light Poster

Hi all,

I am new to asp.net programming and i have a 2 queries :
I am using a web form to allow the user to enter values into a database and i am successful in performing this task. now i have another form for retrieving values from the database also, i have put 3 drop down lists which are databounded

1. Now My requirement is I have a drop down list for Name and if the user selects a value from the Name drop down list the respective values for that particular name has to be changed including the values in the drop down lists which are databounded. I have written some part of the code in the Page_Load. I dont know how to write a code for saving the changed values into the database.

2. My second requirement is i am using a gridview for displaying the data and i have been asked to put a hyperlink at each value of "Name" and if the user clicks on the link he should be redirected to the Edit page(the page regarding which i was telling in the first one).

3. I have to make the above pages as child pages in a Master page but i am not able to do that how can we add a master page for an existing website?

My code for retrieving the values is below here:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim DBConn As New Data.SqlClient.SqlConnection("Data Source=server2;Initial Catalog=HRDATA;Persist Security Info=True;User ID=sa;Password=pass#word1")
    Dim DBCmd As New Data.SqlClient.SqlCommand
        Dim DBAdap As New Data.SqlClient.SqlDataAdapter
        Dim DS As New Data.DataSet
        DBConn.Open()
 	'In the below line only the values for Name asdf are displyed
        Dim DBCmd As New Data.SqlClient.SqlCommand("Select * from Employeedata where EName=asdf", DBConn)
        dataReader = DBCmd.ExecuteReader()
        If (dataReader.Read()) Then
            txtdept.Text = dataReader("Department").ToString()
            txtdesig.Text = dataReader("Designation").ToString()
            txtcnum.Text = dataReader("ContactNumber").ToString()
            txtemercont.Text = dataReader("EmergencyContact").ToString()
            txtofficenum.Text = dataReader("OfficeNumber").ToString()
            txtemailid.Text = dataReader("Email").ToString()
            txtpid.Text = dataReader("PersonalEmail").ToString()
            txt_dob.Text = dataReader("Dob").ToString()
            txtdoj.Text = dataReader("Doj").ToString()
            txtaddress.Text = dataReader("Address").ToString()
            txtbgrp.Text = dataReader("BloodGroup").ToString()
            txtbankname.Text = dataReader("BankName").ToString()
            txtbranch.Text = dataReader("Branch").ToString()
            txtaccountnum.Text = dataReader("AccountNumber").ToString()
            txtsal.Text = dataReader("Salary").ToString()
        End If
        DBConn.Close()
        dataReader.Close()
End Class

PLease suggest me with a solution or any other tutorial which explains in detail:

Thanks In advance,
karthik.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.