Private Sub dept_num_TextChanged_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles dept_num.TextChanged Dim con As SqlConnection = New SqlConnection("Data Source=S-MHAMEED\SQL2008RTWO;Initial Catalog=comp.task;User ID=sa;Password=likebefore") Using (con) Dim dt As New DataTable Dim sqlCom As New SqlCommand() Dim sqlDA As New SqlDataAdapter() sqlCom.Connection = con sqlCom.CommandText = "insert_dept" sqlCom.CommandType = CommandType.StoredProcedure sqlCom.Parameters.AddWithValue("dept_id", Val(dept_num.Text)) sqlDA = New SqlDataAdapter(sqlCom) sqlDA.Fill(dt) If dt.Rows.Count Then dept_name.Text = dt.Rows(0).Item("debt_name") emp_num.Text = dt.Rows(0).Item("debt_emp") End If End Using
i want to fill data when i insert the id in id text box Here is my code but when i insert id dept nothing shows ???
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)