Thank you for the reply, Levy. The code for the form follows, and thank you again for your time and effort. dotnetnubie.
Public Class WebForm1
Inherits System.Web.UI.Page
Protected WithEvents Label1 As System.Web.UI.WebControls.Label
Protected WithEvents DropDownList1 As System.Web.UI.WebControls.DropDownList
Protected WithEvents Button1 As System.Web.UI.WebControls.Button
Protected WithEvents Label2 As System.Web.UI.WebControls.Label
Protected WithEvents DropDownList2 As System.Web.UI.WebControls.DropDownList
Protected WithEvents dg_hremployees As System.Web.UI.WebControls.DataGrid
Protected WithEvents SqlDataAdapter1 As System.Data.SqlClient.SqlDataAdapter
Protected WithEvents SqlConnection1 As System.Data.SqlClient.SqlConnection
Protected WithEvents Ds_fspersonnel1 As FireSafeHR.ds_fspersonnel
Protected WithEvents Label_Company As System.Web.UI.WebControls.Label
Protected WithEvents company_logo As System.Web.UI.WebControls.Image
Protected WithEvents Dropdownlist3 As System.Web.UI.WebControls.DropDownList
Protected WithEvents SqlSelectCommand1 As System.Data.SqlClient.SqlCommand
Protected WithEvents SqlInsertCommand1 As System.Data.SqlClient.SqlCommand
Protected WithEvents SqlUpdateCommand1 As System.Data.SqlClient.SqlCommand
Protected WithEvents SqlDeleteCommand1 As System.Data.SqlClient.SqlCommand
Public company_id As String
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.SqlDataAdapter1 = New System.Data.SqlClient.SqlDataAdapter
Me.SqlConnection1 = New System.Data.SqlClient.SqlConnection
Me.Ds_fspersonnel1 = New FireSafeHR.ds_fspersonnel
Me.SqlSelectCommand1 = New System.Data.SqlClient.SqlCommand
Me.SqlInsertCommand1 = New System.Data.SqlClient.SqlCommand
Me.SqlUpdateCommand1 = New System.Data.SqlClient.SqlCommand
Me.SqlDeleteCommand1 = New System.Data.SqlClient.SqlCommand
CType(Me.Ds_fspersonnel1, System.ComponentModel.ISupportInitialize).BeginInit()
'
'SqlDataAdapter1
'
Me.SqlDataAdapter1.DeleteCommand = Me.SqlDeleteCommand1
Me.SqlDataAdapter1.InsertCommand = Me.SqlInsertCommand1
Me.SqlDataAdapter1.SelectCommand = Me.SqlSelectCommand1
Me.SqlDataAdapter1.TableMappings.AddRange(New System.Data.Common.DataTableMapping() {New System.Data.Common.DataTableMapping("Table", "fs_personnel", New System.Data.Common.DataColumnMapping() {New System.Data.Common.DataColumnMapping("NAME", "NAME"), New System.Data.Common.DataColumnMapping("CATEGORY", "CATEGORY"), New System.Data.Common.DataColumnMapping("COMPANY_ID", "COMPANY_ID"), New System.Data.Common.DataColumnMapping("EMP_ID", "EMP_ID")})})
Me.SqlDataAdapter1.UpdateCommand = Me.SqlUpdateCommand1
'
'SqlConnection1
'
Me.SqlConnection1.ConnectionString = "workstation id=REDWATER1;packet size=4096;user id=firesafehr;data source=localhos" & _
"t;persist security info=True;initial catalog=FireSafeHR;password=firesafehr"
'
'Ds_fspersonnel1
'
Me.Ds_fspersonnel1.DataSetName = "ds_fspersonnel"
Me.Ds_fspersonnel1.Locale = New System.Globalization.CultureInfo("en-US")
'
'SqlSelectCommand1
'
Me.SqlSelectCommand1.CommandText = "[HRSelectCommand]"
Me.SqlSelectCommand1.CommandType = System.Data.CommandType.StoredProcedure
Me.SqlSelectCommand1.Connection = Me.SqlConnection1
Me.SqlSelectCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, False, CType(0, Byte), CType(0, Byte), "", System.Data.DataRowVersion.Current, Nothing))
'
'SqlInsertCommand1
'
Me.SqlInsertCommand1.CommandText = "[HRInsertCommand]"
Me.SqlInsertCommand1.CommandType = System.Data.CommandType.StoredProcedure
Me.SqlInsertCommand1.Connection = Me.SqlConnection1
Me.SqlInsertCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, False, CType(0, Byte), CType(0, Byte), "", System.Data.DataRowVersion.Current, Nothing))
Me.SqlInsertCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@NAME", System.Data.SqlDbType.VarChar, 25, "NAME"))
Me.SqlInsertCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@CATEGORY", System.Data.SqlDbType.VarChar, 1, "CATEGORY"))
Me.SqlInsertCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@COMPANY_ID", System.Data.SqlDbType.VarChar, 10, "COMPANY_ID"))
Me.SqlInsertCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@EMP_ID", System.Data.SqlDbType.VarChar, 10, "EMP_ID"))
'
'SqlUpdateCommand1
'
Me.SqlUpdateCommand1.CommandText = "[HRUpdateCommand]"
Me.SqlUpdateCommand1.CommandType = System.Data.CommandType.StoredProcedure
Me.SqlUpdateCommand1.Connection = Me.SqlConnection1
Me.SqlUpdateCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, False, CType(0, Byte), CType(0, Byte), "", System.Data.DataRowVersion.Current, Nothing))
Me.SqlUpdateCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@NAME", System.Data.SqlDbType.VarChar, 25, "NAME"))
Me.SqlUpdateCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@CATEGORY", System.Data.SqlDbType.VarChar, 1, "CATEGORY"))
Me.SqlUpdateCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@COMPANY_ID", System.Data.SqlDbType.VarChar, 10, "COMPANY_ID"))
Me.SqlUpdateCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@EMP_ID", System.Data.SqlDbType.VarChar, 10, "EMP_ID"))
Me.SqlUpdateCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_COMPANY_ID", System.Data.SqlDbType.VarChar, 10, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "COMPANY_ID", System.Data.DataRowVersion.Original, Nothing))
Me.SqlUpdateCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_EMP_ID", System.Data.SqlDbType.VarChar, 10, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "EMP_ID", System.Data.DataRowVersion.Original, Nothing))
Me.SqlUpdateCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_CATEGORY", System.Data.SqlDbType.VarChar, 1, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "CATEGORY", System.Data.DataRowVersion.Original, Nothing))
Me.SqlUpdateCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_NAME", System.Data.SqlDbType.VarChar, 25, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "NAME", System.Data.DataRowVersion.Original, Nothing))
'
'SqlDeleteCommand1
'
Me.SqlDeleteCommand1.CommandText = "[HRDeleteCommand]"
Me.SqlDeleteCommand1.CommandType = System.Data.CommandType.StoredProcedure
Me.SqlDeleteCommand1.Connection = Me.SqlConnection1
Me.SqlDeleteCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, False, CType(0, Byte), CType(0, Byte), "", System.Data.DataRowVersion.Current, Nothing))
Me.SqlDeleteCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_COMPANY_ID", System.Data.SqlDbType.VarChar, 10, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "COMPANY_ID", System.Data.DataRowVersion.Original, Nothing))
Me.SqlDeleteCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_EMP_ID", System.Data.SqlDbType.VarChar, 10, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "EMP_ID", System.Data.DataRowVersion.Original, Nothing))
Me.SqlDeleteCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_CATEGORY", System.Data.SqlDbType.VarChar, 1, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "CATEGORY", System.Data.DataRowVersion.Original, Nothing))
Me.SqlDeleteCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_NAME", System.Data.SqlDbType.VarChar, 25, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "NAME", System.Data.DataRowVersion.Original, Nothing))
CType(Me.Ds_fspersonnel1, System.ComponentModel.ISupportInitialize).EndInit()
End Sub
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Dim company_logo_path As String
company_id = "99999999"
Me.Label_Company.Text = "Sample Company Name"
company_logo_path = "complogos/" & company_id & ".jpg"
Me.company_logo.ImageUrl = company_logo_path
Me.DropDownList2.Visible = False
Me.Dropdownlist3.Visible = False
Me.Ds_fspersonnel1.Clear()
Me.SqlDataAdapter1.Fill(Ds_fspersonnel1)
Me.dg_hremployees.Visible = True
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If DropDownList1.SelectedItem.Value = 1 Then
Me.Label1.Text = DropDownList1.SelectedItem.Text
Me.Label1.ForeColor = System.Drawing.Color.Green
Me.DropDownList2.Visible = True
Me.Dropdownlist3.Visible = True
ElseIf DropDownList1.SelectedItem.Value = 2 Then
Me.Label1.Text = DropDownList1.SelectedItem.Text
Me.Label1.ForeColor = System.Drawing.Color.Gray
Me.DropDownList2.Visible = True
Me.Dropdownlist3.Visible = True
ElseIf DropDownList1.SelectedItem.Value = 3 Then
Me.Label1.Text = DropDownList1.SelectedItem.Text
Me.Label1.ForeColor = System.Drawing.Color.Blue
Me.DropDownList2.Visible = True
Me.Dropdownlist3.Visible = True
ElseIf DropDownList1.SelectedItem.Value = 4 Then
Me.Label1.Text = DropDownList1.SelectedItem.Text
Me.Label1.ForeColor = System.Drawing.Color.Red
Me.DropDownList2.Visible = True
Me.Dropdownlist3.Visible = True
Else
Me.DropDownList2.Visible = False
Me.Dropdownlist3.Visible = False
Me.Label1.Text = " "
End If
End Sub
End Class