Sir,

            I am having the Coding like this,

 

Sub Page_Load(sender As Object e As EventArgs)

        If IsPostBack() = False Then

            DropCCodes()

        End If

    End Sub

 

 Sub DropCCodes()

 Dim Con As SqlConnection

 Dim Cmd As SqlCommand

 Dim rs As SqlDataReader

 

 Con = New SqlConnection

("database=payrull;server=lc2000;uid=sa;pwd=;")

 Cmd = New SqlCommand

("Select Deptname,DeptCode from Dept ", Con)

 Con.Open()

  rs = Cmd.ExecuteReader()

 DropDownList1.DataSource = rs

 DropDownList1.DataTextField = "DeptName"

 DropDownList1.DataValueField = "DeptCode"

 DropDownList1.DataBind()

 Con.Close()

 End Sub

 

Sub InsertData()

Dim Con As SqlConnection

Dim Cmd As SqlCommand

Dim rs As SqlDataReader

Con = New SqlConnection

("database=payrull;server=lc2000;uid=sa;pwd=;")

Cmd = New SqlCommand

("Select Emp_name,Dept_code from paymast 

where [EMAIL PROTECTED]", Con)

Cmd.CommandType = CommandType.StoredProcedure

With Cmd.Parameters

.Add("@pEmp_no", Emp_no.Text)

End With

Con.Open()

rs = Cmd.ExecuteReader

 

If rs.Read Then

Emp_name.Text = rs("Emp_name")

* DropDownList1.SelectedValue = rs("Dept_Code")

End If

 

End sub

 

I want to list * Dropdownlist1 as Value

 

Please Help me Sir.

 

 

 


Yahoo! India Matrimony: Find your life partneronline.

[Non-text portions of this message have been removed]



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to