Public Function GetData(ByVal prefixText As String) As String()
Dim constr As String = ConfigurationManager.ConnectionStrings("DORMDBConnectionString").ConnectionString.ToString
Dim sql As String = "select * from Student where Student_ID like @prefixText"
Dim da As New SqlDataAdapter(sql, constr)
da.SelectCommand.Parameters.Add("@prefixText", SqlDbType.VarChar, 50).Value = prefixText & "%"
Dim dt As New DataTable
da.Fill(dt)
Dim items(dt.Rows.Count) As String
Dim i As Integer = 0
For Each dr As DataRow In dt.Rows
items.SetValue(dr("Student_ID").ToString, i)
i = i + 1
Next
Return items
End Function
Dim constr As String = ConfigurationManager.ConnectionStrings("DORMDBConnectionString").ConnectionString.ToString
Dim sql As String = "select * from Student where Student_ID like @prefixText"
Dim da As New SqlDataAdapter(sql, constr)
da.SelectCommand.Parameters.Add("@prefixText", SqlDbType.VarChar, 50).Value = prefixText & "%"